Skip to content

Commit c5b2244

Browse files
vdclouisfilipesilva
authored andcommitted
feat(build): use NamedModulesPlugin with HMR
Fix #3679 Close #4037
1 parent c034a44 commit c5b2244

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"@types/rimraf": "0.0.25-alpha",
141141
"@types/semver": "^5.3.30",
142142
"@types/source-map": "^0.5.0",
143-
"@types/webpack": "^1.12.22-alpha",
143+
"@types/webpack": "2.2.0",
144144
"chai": "^3.5.0",
145145
"conventional-changelog": "^1.1.0",
146146
"dtsgenerator": "^0.7.1",

packages/angular-cli/models/webpack-build-production.ts

-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ import {CompressionPlugin} from '../lib/webpack/compression-plugin';
44
const autoprefixer = require('autoprefixer');
55
const postcssDiscardComments = require('postcss-discard-comments');
66

7-
declare module 'webpack' {
8-
export interface LoaderOptionsPlugin {}
9-
export interface LoaderOptionsPluginStatic {
10-
new (optionsObject: any): LoaderOptionsPlugin;
11-
}
12-
interface Webpack {
13-
LoaderOptionsPlugin: LoaderOptionsPluginStatic;
14-
}
15-
}
16-
177
export const getWebpackProdConfigPartial = function(projectRoot: string,
188
appConfig: any,
199
sourcemap: boolean,

packages/angular-cli/tasks/serve-webpack.ts

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default Task.extend({
5858
ui.writeLine(' for information on working with HMR for Webpack.');
5959
entryPoints.push('webpack/hot/dev-server');
6060
config.plugins.push(new webpack.HotModuleReplacementPlugin());
61+
config.plugins.push(new webpack.NamedModulesPlugin());
6162
if (serveTaskOptions.extractCss) {
6263
ui.writeLine(oneLine`
6364
${chalk.yellow('NOTICE')} (HMR) does not allow for CSS hot reload when used

0 commit comments

Comments
 (0)