Skip to content

Commit

Permalink
fix/ Replace AotPlugin to AngularCompilerPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegris committed Nov 18, 2017
1 parent 87e695d commit bef106e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic()
.bootstrapModule(AppModule, {
preserveWhitespaces: false
})
.catch(err => console.error(err));
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowJs": true,
"allowJs": false,
"target": "es5",
"paths": {
"environments": [
Expand Down
5 changes: 3 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ConcatPlugin = require('webpack-concat-plugin');
const { NoEmitOnErrorsPlugin, LoaderOptionsPlugin, DefinePlugin, HashedModuleIdsPlugin } = require('webpack');
const { GlobCopyWebpackPlugin, BaseHrefWebpackPlugin, InsertConcatAssetsWebpackPlugin } = require('@angular/cli/plugins/webpack');
const { CommonsChunkPlugin, UglifyJsPlugin } = require('webpack').optimize;
const { AotPlugin } = require('@ngtools/webpack');
const { AngularCompilerPlugin } = require('@ngtools/webpack');

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

plugins.push(new AotPlugin({
plugins.push(new AngularCompilerPlugin({
entryModule: "src/app/app.module#AppModule",
"mainPath": "main.ts",
"hostReplacementPaths": {
"environments/index.ts": "environments/index.prod.ts"
Expand Down

0 comments on commit bef106e

Please sign in to comment.