From 9f624d150c6f5e05185ff93f4eed12d570e4ccc4 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Mon, 21 Dec 2020 12:31:34 +0100 Subject: 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 --- webpack.common.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: { -- cgit v1.2.3