Skip to content

Commit

Permalink
feat(build): use NamedModulesPlugin with HMR
Browse files Browse the repository at this point in the history
Fix #3679
Close #4037
  • Loading branch information
vdclouis authored and filipesilva committed Jan 18, 2017
1 parent c034a44 commit c5b2244
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"@types/rimraf": "0.0.25-alpha",
"@types/semver": "^5.3.30",
"@types/source-map": "^0.5.0",
"@types/webpack": "^1.12.22-alpha",
"@types/webpack": "2.2.0",
"chai": "^3.5.0",
"conventional-changelog": "^1.1.0",
"dtsgenerator": "^0.7.1",
Expand Down
10 changes: 0 additions & 10 deletions packages/angular-cli/models/webpack-build-production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ import {CompressionPlugin} from '../lib/webpack/compression-plugin';
const autoprefixer = require('autoprefixer');
const postcssDiscardComments = require('postcss-discard-comments');

declare module 'webpack' {
export interface LoaderOptionsPlugin {}
export interface LoaderOptionsPluginStatic {
new (optionsObject: any): LoaderOptionsPlugin;
}
interface Webpack {
LoaderOptionsPlugin: LoaderOptionsPluginStatic;
}
}

export const getWebpackProdConfigPartial = function(projectRoot: string,
appConfig: any,
sourcemap: boolean,
Expand Down
1 change: 1 addition & 0 deletions packages/angular-cli/tasks/serve-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default Task.extend({
ui.writeLine(' for information on working with HMR for Webpack.');
entryPoints.push('webpack/hot/dev-server');
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.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 c5b2244

Please sign in to comment.