From a2b158be88a021b79480af93ea8badc03e998a17 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 31 Mar 2020 16:30:05 +0200 Subject: [PATCH] feat(@schematics/angular): enable lazy loading on the server for new projects With this change, lazy-loading on the server becomes enabled out of the box for new projects. This is because webpack will only split ES6 imports into separate chunks. However when using commonjs all lazy loaded paths will be concatenated into the main.js file. --- .../universal/files/root/__tsconfigFileName__.json.template | 1 - packages/schematics/angular/universal/index_spec.ts | 2 -- .../build_angular/hello-world-app-ve/src/tsconfig.server.json | 1 - .../build_angular/hello-world-app/src/tsconfig.server.json | 1 - 4 files changed, 5 deletions(-) diff --git a/packages/schematics/angular/universal/files/root/__tsconfigFileName__.json.template b/packages/schematics/angular/universal/files/root/__tsconfigFileName__.json.template index 06b8b6ee92dc..8c588ac885c8 100644 --- a/packages/schematics/angular/universal/files/root/__tsconfigFileName__.json.template +++ b/packages/schematics/angular/universal/files/root/__tsconfigFileName__.json.template @@ -2,7 +2,6 @@ "extends": "./<%= tsConfigExtends %>", "compilerOptions": { "outDir": "<%= outDir %>-server", - "module": "commonjs", "types": [ "node" ] diff --git a/packages/schematics/angular/universal/index_spec.ts b/packages/schematics/angular/universal/index_spec.ts index b6d072eef9c4..291c48da379b 100644 --- a/packages/schematics/angular/universal/index_spec.ts +++ b/packages/schematics/angular/universal/index_spec.ts @@ -91,7 +91,6 @@ describe('Universal Schematic', () => { extends: './tsconfig.app.json', compilerOptions: { outDir: './out-tsc/app-server', - module: 'commonjs', types: ['node'], }, files: [ @@ -116,7 +115,6 @@ describe('Universal Schematic', () => { extends: './tsconfig.app.json', compilerOptions: { outDir: '../../out-tsc/app-server', - module: 'commonjs', types: ['node'], }, files: [ diff --git a/tests/angular_devkit/build_angular/hello-world-app-ve/src/tsconfig.server.json b/tests/angular_devkit/build_angular/hello-world-app-ve/src/tsconfig.server.json index ca19d0259199..f3c0d685c1dc 100644 --- a/tests/angular_devkit/build_angular/hello-world-app-ve/src/tsconfig.server.json +++ b/tests/angular_devkit/build_angular/hello-world-app-ve/src/tsconfig.server.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.app.json", "compilerOptions": { "outDir": "../dist-server", - "module": "commonjs", "types": [] }, "files": [ diff --git a/tests/angular_devkit/build_angular/hello-world-app/src/tsconfig.server.json b/tests/angular_devkit/build_angular/hello-world-app/src/tsconfig.server.json index eb321efe8f51..b80c86c867df 100644 --- a/tests/angular_devkit/build_angular/hello-world-app/src/tsconfig.server.json +++ b/tests/angular_devkit/build_angular/hello-world-app/src/tsconfig.server.json @@ -3,7 +3,6 @@ "compilerOptions": { "outDir": "../dist-server", "baseUrl": "./", - "module": "commonjs", "types": [] }, "files": [