feat(v2): use contenthash instead of chunkhash for longterm caching (#1686)

* feat(v2): use contenthash instead of chunkhash for longterm caching

* changelog
This commit is contained in:
Endi 2019-07-22 00:11:39 +07:00 committed by Yangshun Tay
parent 779c847a86
commit 55ef751f26
4 changed files with 21 additions and 6 deletions

View File

@ -2,6 +2,10 @@
## Unreleased
- Use contenthash instead of chunkhash for better long term caching
## 2.0.0-alpha.23
- Fix docusaurus route config generation for certain edge case
## 2.0.0-alpha.22

View File

@ -35,7 +35,7 @@
"@types/react-dev-utils": "^9.0.1",
"@types/semver": "^6.0.1",
"@types/shelljs": "^0.8.5",
"@types/webpack": "^4.4.31",
"@types/webpack": "^4.32.0",
"@types/webpack-dev-server": "^3.1.5",
"@types/webpack-merge": "^4.1.5",
"babel-eslint": "8",

View File

@ -38,8 +38,8 @@ export function createBaseConfig(
output: {
pathinfo: false,
path: outDir,
filename: isProd ? '[name].[chunkhash].js' : '[name].js',
chunkFilename: isProd ? '[name].[chunkhash].js' : '[name].js',
filename: isProd ? '[name].[contenthash].js' : '[name].js',
chunkFilename: isProd ? '[name].[contenthash].js' : '[name].js',
publicPath: baseUrl,
},
// Don't throw warning when asset created is over 250kb
@ -138,8 +138,8 @@ export function createBaseConfig(
},
plugins: [
new MiniCssExtractPlugin({
filename: isProd ? '[name].[chunkhash].css' : '[name].css',
chunkFilename: isProd ? '[name].[chunkhash].css' : '[name].css',
filename: isProd ? '[name].[contenthash].css' : '[name].css',
chunkFilename: isProd ? '[name].[contenthash].css' : '[name].css',
}),
],
};

View File

@ -2564,7 +2564,7 @@
dependencies:
"@types/webpack" "*"
"@types/webpack@*", "@types/webpack@^4.4.31":
"@types/webpack@*":
version "4.4.32"
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.4.32.tgz#2d460cd33a15e568e93f38de5e628cf846396c51"
integrity sha512-mNARoaSJTzbiHxtZbf9NULFilu2frqD+g9Iyl9V2jPYJWXi+AC3Hz8lQWPZ5LLtgUm7iF4SDDMB/1bPrbRQgFw==
@ -2575,6 +2575,17 @@
"@types/uglify-js" "*"
source-map "^0.6.0"
"@types/webpack@^4.32.0":
version "4.32.0"
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.32.0.tgz#bd4a149964cd471538f2781f2be5f9815175463b"
integrity sha512-kpz5wHDyG/WEpzX9gcwFp/w0oSsq0n/rmFdJelk/QBMHmNIOZdiTDInV0Lj8itGKBahQrBgJGJRss/6UHgLuKg==
dependencies:
"@types/anymatch" "*"
"@types/node" "*"
"@types/tapable" "*"
"@types/uglify-js" "*"
source-map "^0.6.0"
"@types/yargs@^12.0.2", "@types/yargs@^12.0.9":
version "12.0.12"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916"