Skip to content

Commit bef106e

Browse files
committed
fix/ Replace AotPlugin to AngularCompilerPlugin
1 parent 87e695d commit bef106e

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Diff for: src/main.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ if (environment.production) {
88
enableProdMode();
99
}
1010

11-
platformBrowserDynamic().bootstrapModule(AppModule);
11+
platformBrowserDynamic()
12+
.bootstrapModule(AppModule, {
13+
preserveWhitespaces: false
14+
})
15+
.catch(err => console.error(err));

Diff for: tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"moduleResolution": "node",
99
"emitDecoratorMetadata": true,
1010
"experimentalDecorators": true,
11-
"allowJs": true,
11+
"allowJs": false,
1212
"target": "es5",
1313
"paths": {
1414
"environments": [

Diff for: webpack.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const ConcatPlugin = require('webpack-concat-plugin');
1010
const { NoEmitOnErrorsPlugin, LoaderOptionsPlugin, DefinePlugin, HashedModuleIdsPlugin } = require('webpack');
1111
const { GlobCopyWebpackPlugin, BaseHrefWebpackPlugin, InsertConcatAssetsWebpackPlugin } = require('@angular/cli/plugins/webpack');
1212
const { CommonsChunkPlugin, UglifyJsPlugin } = require('webpack').optimize;
13-
const { AotPlugin } = require('@ngtools/webpack');
13+
const { AngularCompilerPlugin } = require('@ngtools/webpack');
1414

1515
const nodeModules = path.join(process.cwd(), 'node_modules');
1616
const entryPoints = ["inline", "polyfills", "sw-register", "styles", "vendor", "main"];
@@ -165,7 +165,8 @@ if(scripts.length > 0){
165165
"hashDigestLength": 4
166166
}));
167167

168-
plugins.push(new AotPlugin({
168+
plugins.push(new AngularCompilerPlugin({
169+
entryModule: "src/app/app.module#AppModule",
169170
"mainPath": "main.ts",
170171
"hostReplacementPaths": {
171172
"environments/index.ts": "environments/index.prod.ts"

0 commit comments

Comments
 (0)