Skip to content

Commit e3aea5d

Browse files
committed
tweaks thanks to Stof!
1 parent 6f46ccd commit e3aea5d

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
@@ -243,20 +243,15 @@ class ConfigGenerator {
243243
* * https://github.com/webpack/webpack.js.org/issues/652#issuecomment-273324529
244244
* * https://webpack.js.org/guides/caching/#deterministic-hashes
245245
*/
246-
let moduleNamePlugin;
247246
if (this.webpackConfig.isProduction()) {
248247
// shorter, and obfuscated module ids (versus NamedModulesPlugin)
249248
// makes the final assets *slightly* larger, but prevents contents
250249
// from sometimes changing when nothing really changed
251-
moduleNamePlugin = new webpack.HashedModuleIdsPlugin();
250+
plugins.push(new webpack.HashedModuleIdsPlugin());
252251
} else {
253252
// human-readable module names, helps debug in HMR
254-
// enable always when ! production for consistency
255-
moduleNamePlugin = new webpack.NamedModulesPlugin();
256-
}
257-
258-
if (moduleNamePlugin) {
259-
plugins.push(moduleNamePlugin);
253+
// enable always when not in production for consistency
254+
plugins.push(new webpack.NamedModulesPlugin());
260255
}
261256

262257
if (this.webpackConfig.useVersioning) {

0 commit comments

Comments
 (0)