mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-22 20:47:53 +02:00
feat(v2): Cache hashed assets to dedicated folders (#3998)
This commit is contained in:
parent
6cb99bfe73
commit
f48d435ce4
1 changed files with 10 additions and 4 deletions
|
@ -77,8 +77,10 @@ export function createBaseConfig(
|
||||||
futureEmitAssets: true,
|
futureEmitAssets: true,
|
||||||
pathinfo: false,
|
pathinfo: false,
|
||||||
path: outDir,
|
path: outDir,
|
||||||
filename: isProd ? '[name].[contenthash:8].js' : '[name].js',
|
filename: isProd ? 'assets/js/[name].[contenthash:8].js' : '[name].js',
|
||||||
chunkFilename: isProd ? '[name].[contenthash:8].js' : '[name].js',
|
chunkFilename: isProd
|
||||||
|
? 'assets/js/[name].[contenthash:8].js'
|
||||||
|
: '[name].js',
|
||||||
publicPath: baseUrl,
|
publicPath: baseUrl,
|
||||||
},
|
},
|
||||||
// Don't throw warning when asset created is over 250kb
|
// Don't throw warning when asset created is over 250kb
|
||||||
|
@ -188,8 +190,12 @@ export function createBaseConfig(
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
filename: isProd ? '[name].[contenthash:8].css' : '[name].css',
|
filename: isProd
|
||||||
chunkFilename: isProd ? '[name].[contenthash:8].css' : '[name].css',
|
? 'assets/css/[name].[contenthash:8].css'
|
||||||
|
: '[name].css',
|
||||||
|
chunkFilename: isProd
|
||||||
|
? 'assets/css/[name].[contenthash:8].css'
|
||||||
|
: '[name].css',
|
||||||
// remove css order warnings if css imports are not sorted alphabetically
|
// remove css order warnings if css imports are not sorted alphabetically
|
||||||
// see https://github.com/webpack-contrib/mini-css-extract-plugin/pull/422 for more reasoning
|
// see https://github.com/webpack-contrib/mini-css-extract-plugin/pull/422 for more reasoning
|
||||||
ignoreOrder: true,
|
ignoreOrder: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue