fix(@schematics/angular): remove baseUrl from universal tsconfig

The baseUrl is used for non relative module imports, and we should always use the baseUrl set in the workspace tsconfig. When having path mappings set at workspace level and setting a `baseUrl` in the server tsconfig, this paths will no longer work as paths mapping as relative to the baseUrl.

Fixes #13935
This commit is contained in:
Alan Agius 2019-03-18 10:15:44 +01:00 committed by Alex Eagle
parent 2ecdddc115
commit 10fb461829
2 changed files with 4 additions and 7 deletions

View File

@ -1,10 +1,9 @@
{
"extends": "./<%= tsConfigExtends %>",
"compilerOptions": {
"outDir": "<%= outDir %>-server",
"baseUrl": "."
"outDir": "<%= outDir %>-server"
},
"angularCompilerOptions": {
"entryModule": "<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>"
"entryModule": "./<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>"
}
}

View File

@ -80,10 +80,9 @@ describe('Universal Schematic', () => {
extends: './tsconfig.app.json',
compilerOptions: {
outDir: './out-tsc/app-server',
baseUrl: '.',
},
angularCompilerOptions: {
entryModule: 'src/app/app.server.module#AppServerModule',
entryModule: './src/app/app.server.module#AppServerModule',
},
});
const angularConfig = JSON.parse(tree.readContent('angular.json'));
@ -100,10 +99,9 @@ describe('Universal Schematic', () => {
extends: './tsconfig.app.json',
compilerOptions: {
outDir: '../../out-tsc/app-server',
baseUrl: '.',
},
angularCompilerOptions: {
entryModule: 'src/app/app.server.module#AppServerModule',
entryModule: './src/app/app.server.module#AppServerModule',
},
});
const angularConfig = JSON.parse(tree.readContent('angular.json'));