From c8ef2a648482babd18e03a71818e2f8b9fce125e Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Wed, 20 Sep 2023 18:01:30 -0700 Subject: [PATCH] Fix mojibake (#7073) Add charset preamble to generated css --- .webpack/webpack.common.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.webpack/webpack.common.js b/.webpack/webpack.common.js index 302211defff..737a7cab39e 100644 --- a/.webpack/webpack.common.js +++ b/.webpack/webpack.common.js @@ -100,6 +100,12 @@ const config = { new MiniCssExtractPlugin({ filename: '[name].css', chunkFilename: '[name].css' + }), + // Add a UTF-8 BOM to CSS output to avoid random mojibake + new webpack.BannerPlugin({ + test: /.*Theme\.css$/, + raw: true, + banner: '@charset "UTF-8";', }) ], module: {