Skip to content

Commit

Permalink
fix(@schematics/angular): add commonjs module to universal tsconfig (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
alan-agius4 authored and mgechev committed Jul 16, 2019
1 parent 0c94e2b commit 1bc04b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "./<%= tsConfigExtends %>",
"compilerOptions": {
"outDir": "<%= outDir %>-server"
"outDir": "<%= outDir %>-server",
"module": "commonjs"
},
"angularCompilerOptions": {
"entryModule": "./<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>"
Expand Down
2 changes: 2 additions & 0 deletions packages/schematics/angular/universal/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ describe('Universal Schematic', () => {
extends: './tsconfig.app.json',
compilerOptions: {
outDir: './out-tsc/app-server',
module: 'commonjs',
},
angularCompilerOptions: {
entryModule: './src/app/app.server.module#AppServerModule',
Expand All @@ -110,6 +111,7 @@ describe('Universal Schematic', () => {
extends: './tsconfig.app.json',
compilerOptions: {
outDir: '../../out-tsc/app-server',
module: 'commonjs',
},
angularCompilerOptions: {
entryModule: './src/app/app.server.module#AppServerModule',
Expand Down

0 comments on commit 1bc04b0

Please sign in to comment.