Skip to content
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

@charset is stripped from the css #8713

Closed
domenkozar opened this issue Dec 22, 2022 · 2 comments
Closed

@charset is stripped from the css #8713

domenkozar opened this issue Dec 22, 2022 · 2 comments

Comments

@domenkozar
Copy link

domenkozar commented Dec 22, 2022

Given main.css:

@charset "UTF-8";

div {
	margin: 0;
}

It strips @charset:

❯ yarn run parcel build main.css
yarn run v1.22.19
warning package.json: No license field
$ /home/domen/dev/parcel-repro-css-charset/node_modules/.bin/parcel build main.css
✨ Built in 136ms

dist/main.css    51 B    31ms
Done in 0.57s.

❯ cat dist/main.css
div{margin:0}
/*# sourceMappingURL=main.css.map */

workaround

    file=$(ls dist/index*.css)
    echo -e "@charset "UTF-8";\n$(cat $file)" > $file
@mischnic
Copy link
Member

Related: parcel-bundler/lightningcss#310

@devongovett
Copy link
Member

Going to close and keep discussion on the Lightning CSS repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants