Skip to content

Commit 432fe97

Browse files
alan-agius4Keen Yee Liau
authored and
Keen Yee Liau
committed
fix(@schematics/angular): use app root to set server paths in options
1 parent d07e68a commit 432fe97

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/schematics/angular/migrations/update-6/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ function extractProjectsConfig(
536536
if (serverApp) {
537537
const serverOptions: JsonObject = {
538538
outputPath: serverApp.outDir || defaults.serverOutDir,
539-
main: serverApp.main || defaults.serverMain,
540-
tsConfig: serverApp.tsconfig || defaults.serverTsConfig,
539+
main: `${appRoot}/${serverApp.main || defaults.serverMain}`,
540+
tsConfig: `${appRoot}/${serverApp.tsconfig || defaults.serverTsConfig}`,
541541
};
542542
const serverTarget: JsonObject = {
543543
builder: '@angular-devkit/build-angular:server',

packages/schematics/angular/migrations/update-6/index_spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,8 @@ describe('Migration to v6', () => {
992992
expect(target).toBeDefined();
993993
expect(target.builder).toEqual('@angular-devkit/build-angular:server');
994994
expect(target.options.outputPath).toEqual('dist/server');
995-
expect(target.options.main).toEqual('main.server.ts');
996-
expect(target.options.tsConfig).toEqual('tsconfig.server.json');
995+
expect(target.options.main).toEqual('src/main.server.ts');
996+
expect(target.options.tsConfig).toEqual('src/tsconfig.server.json');
997997
});
998998
});
999999
});

0 commit comments

Comments
 (0)