Skip to content

Commit a6e3d84

Browse files
committed
feature #608 Remove webpack-chunk-hash plugin (Lyrkan)
This PR was merged into the master branch. Discussion ---------- Remove webpack-chunk-hash plugin This PR removes the `webpack-chunk-hash` plugin since: * using `[chunkhash]` was deprecated a while ago (in #463) * it seems to be causing issues even when `[chunkhash]` is not used at all (fixes #605) Commits ------- b998ad2 Remove webpack-chunk-hash plugin
2 parents bb5f533 + b998ad2 commit a6e3d84

File tree

7 files changed

+3
-70
lines changed

7 files changed

+3
-70
lines changed

lib/WebpackConfig.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,10 +733,6 @@ class WebpackConfig {
733733
}
734734
}
735735

736-
if (typeof configuredFilenames.js !== 'undefined' && configuredFilenames.js.includes('[chunkhash')) {
737-
logger.deprecation('Using the [chunkhash] placeholder in any filenames is deprecated: use [contenthash] instead.');
738-
}
739-
740736
this.configuredFilenames = configuredFilenames;
741737
}
742738

lib/plugins/plugin-priorities.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module.exports = {
1414
DeleteUnusedEntriesJSPlugin: 130,
1515
WebpackManifestPlugin: 120,
1616
LoaderOptionsPlugin: 110,
17-
WebpackChunkHash: 100,
1817
ProvidePlugin: 90,
1918
CleanWebpackPlugin: 80,
2019
DefinePlugin: 70,

lib/plugins/versioning.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
'use strict';
1111

1212
const webpack = require('webpack');
13-
const WebpackChunkHash = require('webpack-chunk-hash');
1413
const WebpackConfig = require('../WebpackConfig'); //eslint-disable-line no-unused-vars
1514
const PluginPriorities = require('./plugin-priorities');
1615

@@ -49,12 +48,4 @@ module.exports = function(plugins, webpackConfig) {
4948
// No plugin is added. But, see the "optimizations" config,
5049
// for inclusion of the "named modules".
5150
}
52-
53-
if (webpackConfig.useVersioning) {
54-
// enables the [chunkhash] ability, which is deprecated
55-
plugins.push({
56-
plugin: new WebpackChunkHash(),
57-
priority: PluginPriorities.WebpackChunkHash
58-
});
59-
}
6051
};

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"terser-webpack-plugin": "^1.1.0",
5050
"tmp": "^0.0.33",
5151
"webpack": "^4.20.0",
52-
"webpack-chunk-hash": "^0.6.0",
5352
"webpack-cli": "^3.0.0",
5453
"webpack-dev-server": "^3.1.14",
5554
"webpack-manifest-plugin": "^2.0.2",

test/WebpackConfig.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,23 +1113,6 @@ describe('WebpackConfig object', () => {
11131113
});
11141114
}).to.throw('"foo" is not a valid key');
11151115
});
1116-
1117-
it('Using chunkhash is deprecated', () => {
1118-
logger.reset();
1119-
logger.quiet();
1120-
1121-
after(() => {
1122-
logger.quiet(false);
1123-
});
1124-
1125-
const config = createConfig();
1126-
1127-
config.configureFilenames({
1128-
js: 'file.[chunkhash:16].js'
1129-
});
1130-
1131-
expect(logger.getMessages().deprecation).to.not.be.empty;
1132-
});
11331116
});
11341117

11351118
describe('configureUrlLoader', () => {

test/functional.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ describe('Functional tests using webpack', function() {
431431
config.addStyleEntry('styles', './css/h1_style.css');
432432
config.enableVersioning(true);
433433
config.configureFilenames({
434-
js: '[name].js?[chunkhash:16]',
435-
css: '[name].css?[chunkhash:16]'
434+
js: '[name].js?[contenthash:16]',
435+
css: '[name].css?[contenthash:16]'
436436
});
437437

438438
testSetup.runWebpack(config, (webpackAssert) => {
@@ -448,7 +448,7 @@ describe('Functional tests using webpack', function() {
448448
);
449449
webpackAssert.assertManifestPath(
450450
'styles.css',
451-
'/styles.css?91597a40238e0e66'
451+
'/styles.css?8ec316547cc77b39'
452452
);
453453

454454
done();

yarn.lock

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,6 @@
696696
lodash "^4.17.13"
697697
to-fast-properties "^2.0.0"
698698

699-
"@types/anymatch@*":
700-
version "1.3.1"
701-
resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a"
702-
integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==
703-
704699
"@types/events@*":
705700
version "3.0.0"
706701
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
@@ -730,29 +725,6 @@
730725
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8"
731726
integrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==
732727

733-
"@types/tapable@*":
734-
version "1.0.4"
735-
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.4.tgz#b4ffc7dc97b498c969b360a41eee247f82616370"
736-
integrity sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ==
737-
738-
"@types/uglify-js@*":
739-
version "3.0.4"
740-
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082"
741-
integrity sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ==
742-
dependencies:
743-
source-map "^0.6.1"
744-
745-
"@types/webpack@^3.0.0 || ^4.0.0":
746-
version "4.32.1"
747-
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.32.1.tgz#6e95010e806f808abd6551c112097ac09035aacf"
748-
integrity sha512-9n38CBx9uga1FEAdTipnt0EkbKpsCJFh7xJb1LE65FFb/A6OOLFX022vYsGC1IyVCZ/GroNg9u/RMmlDxGcLIw==
749-
dependencies:
750-
"@types/anymatch" "*"
751-
"@types/node" "*"
752-
"@types/tapable" "*"
753-
"@types/uglify-js" "*"
754-
source-map "^0.6.0"
755-
756728
"@vue/babel-helper-vue-jsx-merge-props@^1.0.0", "@vue/babel-helper-vue-jsx-merge-props@^1.0.0-beta.3":
757729
version "1.0.0"
758730
resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0.tgz#048fe579958da408fb7a8b2a3ec050b50a661040"
@@ -8389,13 +8361,6 @@ webidl-conversions@^4.0.2:
83898361
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
83908362
integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
83918363

8392-
webpack-chunk-hash@^0.6.0:
8393-
version "0.6.0"
8394-
resolved "https://registry.yarnpkg.com/webpack-chunk-hash/-/webpack-chunk-hash-0.6.0.tgz#eca36aff76e327d08a18a3e7990eb46e68376818"
8395-
integrity sha512-FsOg1RpW2nf3nYpGTy/Qs59RZ7gYG+sI4VrCE8TIBQYh/Kogi04xD39Pj9zUEeUcNx9HeTVPGSO3mtmpLeX9eQ==
8396-
dependencies:
8397-
"@types/webpack" "^3.0.0 || ^4.0.0"
8398-
83998364
webpack-cli@^3.0.0:
84008365
version "3.3.6"
84018366
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.6.tgz#2c8c399a2642133f8d736a359007a052e060032c"

0 commit comments

Comments
 (0)