Skip to content

Commit

Permalink
feat(@angular/cli): always use named webpack modules in dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Lyding authored and filipesilva committed May 4, 2017
1 parent c298b25 commit b07f631
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/@angular/cli/models/webpack-configs/development.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { NamedModulesPlugin } from 'webpack';

import { WebpackConfigOptions } from '../webpack-config';

export const getDevConfig = function (_wco: WebpackConfigOptions) {
return {};
return {
plugins: [new NamedModulesPlugin()]
};
};
3 changes: 3 additions & 0 deletions packages/@angular/cli/tasks/eject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class JsonWebpackSerializer {
case webpack.NoEmitOnErrorsPlugin:
this._addImport('webpack', 'NoEmitOnErrorsPlugin');
break;
case webpack.NamedModulesPlugin:
this._addImport('webpack', 'NamedModulesPlugin');
break;
case (<any>webpack).HashedModuleIdsPlugin:
this._addImport('webpack', 'HashedModuleIdsPlugin');
break;
Expand Down
1 change: 0 additions & 1 deletion packages/@angular/cli/tasks/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default Task.extend({
ui.writeLine(' for information on working with HMR for Webpack.');
entryPoints.push('webpack/hot/dev-server');
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
webpackConfig.plugins.push(new webpack.NamedModulesPlugin());
if (serveTaskOptions.extractCss) {
ui.writeLine(oneLine`
${chalk.yellow('NOTICE')} (HMR) does not allow for CSS hot reload when used
Expand Down

0 comments on commit b07f631

Please sign in to comment.