Skip to content

Commit

Permalink
refactor: rename nitro ssr app folder to ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Feb 8, 2024
1 parent 3ca1692 commit f3cb6c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions angular/app-types/angular-app-type/angular.application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,8 @@ export class AngularApp implements Application {
}],
metadata: {
outputPath,
nitroDir: join(outputPath, 'nitro'),
publicDir: join(outputPath, 'browser'),
ssrPublicDir: appOptions.ssr ? join(outputPath, 'server') : undefined
ssrPublicDir: appOptions.ssr ? join(outputPath, 'ssr') : undefined
}
};
}
Expand Down
11 changes: 8 additions & 3 deletions angular/app-types/angular-app-type/application.bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import {
} from '@bitdev/angular.dev-services.common';
import {
type ApplicationBuilderOptions,
buildApplicationInternal, type DevServerBuilderOptions
buildApplicationInternal
} from '@bitdev/angular.dev-services.ng-compat';
import { Logger } from '@teambit/logger';
import assert from 'assert';
import { outputFileSync } from 'fs-extra';
import { outputFileSync, removeSync } from 'fs-extra';
// @ts-ignore
import type { NitroConfig } from 'nitropack';
import { basename, extname, join, posix, relative, resolve } from 'path';
Expand Down Expand Up @@ -175,7 +175,7 @@ async function getNitroConfig(options: BuildApplicationOptions): Promise<NitroCo
const outputDir = normalizePath(join(workspaceRoot, outputPath));
const browserDir = normalizePath(resolve(outputDir, 'browser'));
const serverDir = normalizePath(resolve(outputDir, 'server'));
const nitroDir = normalizePath(resolve(outputDir, 'nitro'));
const nitroDir = normalizePath(resolve(outputDir, 'ssr'));
const indexPath = getIndexInputFile(index!);

const prerenderedRoutes = prerender ? (await import(`${ outputDir }/prerendered-routes.json`)).default : undefined;
Expand Down Expand Up @@ -267,5 +267,10 @@ async function buildNitro(options: BuildApplicationOptions): Promise<void> {
await build(nitro);

await nitro.close();

// Clean up the temp server folder generated by Angular
const tempDir = normalizePath(join(options.workspaceRoot, options.outputPath, 'server'));
removeSync(tempDir);

logger.end();
}

0 comments on commit f3cb6c6

Please sign in to comment.