Skip to content

Commit 5185ff4

Browse files
committed
tweaks thanks to Stof!
1 parent ec7a30c commit 5185ff4

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/config-generator.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,20 +324,15 @@ class ConfigGenerator {
324324
* * https://github.com/webpack/webpack.js.org/issues/652#issuecomment-273324529
325325
* * https://webpack.js.org/guides/caching/#deterministic-hashes
326326
*/
327-
let moduleNamePlugin;
328327
if (this.webpackConfig.isProduction()) {
329328
// shorter, and obfuscated module ids (versus NamedModulesPlugin)
330329
// makes the final assets *slightly* larger, but prevents contents
331330
// from sometimes changing when nothing really changed
332-
moduleNamePlugin = new webpack.HashedModuleIdsPlugin();
331+
plugins.push(new webpack.HashedModuleIdsPlugin());
333332
} else {
334333
// human-readable module names, helps debug in HMR
335-
// enable always when ! production for consistency
336-
moduleNamePlugin = new webpack.NamedModulesPlugin();
337-
}
338-
339-
if (moduleNamePlugin) {
340-
plugins.push(moduleNamePlugin);
334+
// enable always when not in production for consistency
335+
plugins.push(new webpack.NamedModulesPlugin());
341336
}
342337

343338
if (this.webpackConfig.useVersioning) {

0 commit comments

Comments
 (0)