Skip to content

Commit 10fb461

Browse files
alan-agius4alexeagle
authored andcommitted
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
1 parent 2ecdddc commit 10fb461

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"extends": "./<%= tsConfigExtends %>",
33
"compilerOptions": {
4-
"outDir": "<%= outDir %>-server",
5-
"baseUrl": "."
4+
"outDir": "<%= outDir %>-server"
65
},
76
"angularCompilerOptions": {
8-
"entryModule": "<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>"
7+
"entryModule": "./<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>"
98
}
109
}

packages/schematics/angular/universal/index_spec.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ describe('Universal Schematic', () => {
8080
extends: './tsconfig.app.json',
8181
compilerOptions: {
8282
outDir: './out-tsc/app-server',
83-
baseUrl: '.',
8483
},
8584
angularCompilerOptions: {
86-
entryModule: 'src/app/app.server.module#AppServerModule',
85+
entryModule: './src/app/app.server.module#AppServerModule',
8786
},
8887
});
8988
const angularConfig = JSON.parse(tree.readContent('angular.json'));
@@ -100,10 +99,9 @@ describe('Universal Schematic', () => {
10099
extends: './tsconfig.app.json',
101100
compilerOptions: {
102101
outDir: '../../out-tsc/app-server',
103-
baseUrl: '.',
104102
},
105103
angularCompilerOptions: {
106-
entryModule: 'src/app/app.server.module#AppServerModule',
104+
entryModule: './src/app/app.server.module#AppServerModule',
107105
},
108106
});
109107
const angularConfig = JSON.parse(tree.readContent('angular.json'));

0 commit comments

Comments
 (0)