Skip to content

Commit 6f46ccd

Browse files
committed
always using a named plugin
1 parent 791e51f commit 6f46ccd

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
@@ -245,11 +245,10 @@ class ConfigGenerator {
245245
*/
246246
let moduleNamePlugin;
247247
if (this.webpackConfig.isProduction()) {
248-
// only enable if versioning is on, as it makes the assets *slightly* larger
249-
if (this.webpackConfig.useVersioning) {
250-
// shorter, and obfuscated module ids
251-
moduleNamePlugin = new webpack.HashedModuleIdsPlugin();
252-
}
248+
// shorter, and obfuscated module ids (versus NamedModulesPlugin)
249+
// makes the final assets *slightly* larger, but prevents contents
250+
// from sometimes changing when nothing really changed
251+
moduleNamePlugin = new webpack.HashedModuleIdsPlugin();
253252
} else {
254253
// human-readable module names, helps debug in HMR
255254
// 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)