-
-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should output UTF-8 BOM when input contains UTF-8 BOM #821
Comments
I think oroblem in |
Also due logic merging modules in one file using |
This is the most frustrated part, as a webpack & sass user we do not have a choice but the BOM is generated by sass. The original SCSS file ( For bundling multiple CSS into one, according to CSS specification, either binary sequence of Reference: |
|
Honestly we have here to remove BOM in |
At least for CSS it treated as the same thing, according to the specification (https://www.w3.org/TR/CSS2/syndata.html#charset) the initial bytes
will change the charset of the CSS parse to be UTF-8 For this reason, As a webpack user, seems |
hm, yes, you are right, just interesting why do you need |
In SCSS even you explicitly write |
Just clarify, do you want:
|
That should be good enough. |
Related webpack-contrib/css-loader#1212 |
Ideally |
We strip |
|
Bug report
When integrate with sass-loader, it will output CSS with UTF-8 BOM (i.e. \uFEFF) at the beginning of the CSS when it is run in production mode. But this plugin seems trimmed the UTF-8 BOM in the final output CSS file.
This is a reproducible sample repository (https://github.com/sammyhk/scss-utf8.git).
Execute
npm run sass
which call sass directly produce the CSS file (./dist/in.scss.bom.min.css
) with UTF-8 BOM included.Execute
npm run build
which involve webpack, sass-loader and this plugin produce the CSS file (./dist/in.scss.min.css
) without UTF-8 BOM.Actual Behavior
Seems this plugin trimmed the UTF-8 BOM and output CSS file without BOM.
Expected Behavior
Should preserve the UTF-8 BOM if exists and output CSS file with BOM.
How Do We Reproduce?
This is a reproducible sample repository (https://github.com/sammyhk/scss-utf8.git).
Execute
npm run sass
which call sass directly produce the CSS file (./dist/in.scss.bom.min.css
) with UTF-8 BOM included.Execute
npm run build
which involve webpack, sass-loader and this plugin produce the CSS file (./dist/in.scss.min.css
) without UTF-8 BOM.Please paste the results of
npx webpack-cli info
here, and mention other relevant informationSystem:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Memory: 2.59 GB / 15.79 GB
Binaries:
Node: 12.22.4 - C:\Program Files\nodejs\node.EXE
npm: 6.14.14 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 92.0.4515.131
Edge: Spartan (44.19041.1023.0), Chromium (92.0.902.84)
Internet Explorer: 11.0.19041.1
Packages:
html-webpack-plugin: ^5.3.2 => 5.3.2
webpack: ^5.51.2 => 5.51.2
webpack-cli: ^4.8.0 => 4.8.0
webpack-dev-server: ^4.1.0 => 4.1.0
The text was updated successfully, but these errors were encountered: