mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-21 20:17:50 +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,
|
||||
pathinfo: false,
|
||||
path: outDir,
|
||||
filename: isProd ? '[name].[contenthash:8].js' : '[name].js',
|
||||
chunkFilename: isProd ? '[name].[contenthash:8].js' : '[name].js',
|
||||
filename: isProd ? 'assets/js/[name].[contenthash:8].js' : '[name].js',
|
||||
chunkFilename: isProd
|
||||
? 'assets/js/[name].[contenthash:8].js'
|
||||
: '[name].js',
|
||||
publicPath: baseUrl,
|
||||
},
|
||||
// Don't throw warning when asset created is over 250kb
|
||||
|
@ -188,8 +190,12 @@ export function createBaseConfig(
|
|||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: isProd ? '[name].[contenthash:8].css' : '[name].css',
|
||||
chunkFilename: isProd ? '[name].[contenthash:8].css' : '[name].css',
|
||||
filename: isProd
|
||||
? '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
|
||||
// see https://github.com/webpack-contrib/mini-css-extract-plugin/pull/422 for more reasoning
|
||||
ignoreOrder: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue