From 8af351ef600e4086025e7331585e93d8406c17f0 Mon Sep 17 00:00:00 2001 From: frederikprijck Date: Tue, 15 Aug 2017 23:45:31 +0200 Subject: [PATCH] Allow lazy loading with AngularSpa in dev build Previously, the AngularSpa didn't include `angular2-router-loader`. This commit ensures it does. Closes #1194 --- templates/AngularSpa/package.json | 1 + templates/AngularSpa/webpack.config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/AngularSpa/package.json b/templates/AngularSpa/package.json index 4d1b203d..523908ac 100644 --- a/templates/AngularSpa/package.json +++ b/templates/AngularSpa/package.json @@ -19,6 +19,7 @@ "@angular/router": "4.2.5", "@ngtools/webpack": "1.5.0", "@types/webpack-env": "1.13.0", + "angular2-router-loader": "0.3.5", "angular2-template-loader": "0.6.2", "aspnet-prerendering": "^3.0.1", "aspnet-webpack": "^2.0.1", diff --git a/templates/AngularSpa/webpack.config.js b/templates/AngularSpa/webpack.config.js index 85e238de..11300dd2 100644 --- a/templates/AngularSpa/webpack.config.js +++ b/templates/AngularSpa/webpack.config.js @@ -17,7 +17,7 @@ module.exports = (env) => { }, module: { rules: [ - { test: /\.ts$/, include: /ClientApp/, use: isDevBuild ? ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] : '@ngtools/webpack' }, + { test: /\.ts$/, include: /ClientApp/, use: isDevBuild ? ['awesome-typescript-loader?silent=true', 'angular2-template-loader', 'angular2-router-loader'] : '@ngtools/webpack' }, { test: /\.html$/, use: 'html-loader?minimize=false' }, { test: /\.css$/, use: [ 'to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize' ] }, { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }