summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mehren2020-12-21 12:31:34 +0100
committerDavid Mehren2020-12-21 12:31:34 +0100
commit9f624d150c6f5e05185ff93f4eed12d570e4ccc4 (patch)
tree60b4a2f66c1603c1b9684f1662280465d9e77e41
parent4c1419a54ed9aa9627c6481f035466b5ab8f5220 (diff)
Generate CSS filenames with contenthash
Previously, .css files always had the same name, which can lead to caching problems. In our case, the new CSS for the HedgeDoc logo was not loaded when Chrome had the 1.6.0 CSS in the cache, leading the HedgeDoc logo filling the whole screen. This commit adds the contenthash to the .css files generated by webpack, which ensures that changed files are always loaded. References: https://github.com/webpack-contrib/mini-css-extract-plugin#filename https://webpack.js.org/configuration/output/#outputfilename Signed-off-by: David Mehren <git@herrmehren.de>
-rw-r--r--webpack.common.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/webpack.common.js b/webpack.common.js
index 9d1a9005..f84a6a13 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -177,7 +177,10 @@ module.exports = {
}
]
}),
- new MiniCssExtractPlugin()
+ new MiniCssExtractPlugin({
+ filename: '[name].[contenthash].css',
+ chunkFilename: '[id].[contenthash].css'
+ })
],
entry: {