Skip to content

Commit d0f2cc3

Browse files
alan-agius4mgechev
authored andcommitted
fix(@schematics/angular): add commonjs module to universal tsconfig (#15090)
The universal tsconfig extends the application tsconfig which by default it's module format is ES2015. While NodeJS 12 does support this, older versions of Node don't
1 parent f8a5821 commit d0f2cc3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/schematics/angular/universal/files/root/__tsconfigFileName__.json.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "./<%= tsConfigExtends %>",
33
"compilerOptions": {
4-
"outDir": "<%= outDir %>-server"
4+
"outDir": "<%= outDir %>-server",
5+
"module": "commonjs"
56
},
67
"angularCompilerOptions": {
78
"entryModule": "./<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>"

packages/schematics/angular/universal/index_spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ describe('Universal Schematic', () => {
9090
extends: './tsconfig.app.json',
9191
compilerOptions: {
9292
outDir: './out-tsc/app-server',
93+
module: 'commonjs',
9394
},
9495
angularCompilerOptions: {
9596
entryModule: './src/app/app.server.module#AppServerModule',
@@ -110,6 +111,7 @@ describe('Universal Schematic', () => {
110111
extends: './tsconfig.app.json',
111112
compilerOptions: {
112113
outDir: '../../out-tsc/app-server',
114+
module: 'commonjs',
113115
},
114116
angularCompilerOptions: {
115117
entryModule: './src/app/app.server.module#AppServerModule',

0 commit comments

Comments
 (0)