Skip to content

Commit ec7a30c

Browse files
committed
always using a named plugin
1 parent c320c3e commit ec7a30c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/config-generator.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,10 @@ class ConfigGenerator {
326326
*/
327327
let moduleNamePlugin;
328328
if (this.webpackConfig.isProduction()) {
329-
// only enable if versioning is on, as it makes the assets *slightly* larger
330-
if (this.webpackConfig.useVersioning) {
331-
// shorter, and obfuscated module ids
332-
moduleNamePlugin = new webpack.HashedModuleIdsPlugin();
333-
}
329+
// shorter, and obfuscated module ids (versus NamedModulesPlugin)
330+
// makes the final assets *slightly* larger, but prevents contents
331+
// from sometimes changing when nothing really changed
332+
moduleNamePlugin = new webpack.HashedModuleIdsPlugin();
334333
} else {
335334
// human-readable module names, helps debug in HMR
336335
// enable always when ! production for consistency

test/config-generator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ describe('The config-generator function', () => {
236236
config.outputPath = '/tmp/output/public-path';
237237
config.publicPath = '/public-path';
238238
config.addEntry('main', './main');
239-
config.enableVersioning(true);
240239

241240
const actualConfig = configGenerator(config);
242241

0 commit comments

Comments
 (0)