From af4ef8c0baeb5a036944850eea308ba2b78846be Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Thu, 21 Sep 2023 11:05:39 -0700 Subject: [PATCH] cherry pick(#7073): Fix Mojibake (#7076) 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 ac25fb6af9..20ef49683e 100644 --- a/.webpack/webpack.common.js +++ b/.webpack/webpack.common.js @@ -110,6 +110,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: {