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>
This commit is contained in:
David Mehren 2020-12-21 12:31:34 +01:00
parent 4c1419a54e
commit 9f624d150c
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -177,7 +177,10 @@ module.exports = {
}
]
}),
new MiniCssExtractPlugin()
new MiniCssExtractPlugin({
filename: '[name].[contenthash].css',
chunkFilename: '[id].[contenthash].css'
})
],
entry: {