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

Each at-rule overwrites the previous pointing to the same output file (Webpack 4) #47

Open
bitfella opened this issue Oct 2, 2019 · 2 comments

Comments

@bitfella
Copy link
Contributor

bitfella commented Oct 2, 2019

Hello, I guess this could be related to #27.

I am using postcss-critical-css with Webpack 4 (Windows 10) and I am facing the following issue: when importing in the same JS entrypoint several scss partials containing critical at-rules pointing to the same output file, seems like the generated css carries just the contents from one of the sources (usually the one from the last saved source file). Each at-rule overwrites the previous. Sometimes partial overwrites could happen as well, generating syntax errors in the output.

This happens for static scss imports and for dynamic imports of JS files carrying scss imports, as well.

See this repo for further explanation.

Thanks

@bitfella bitfella changed the title Each at-rule overwrite the previous pointing to the same output file (Webpack 4) Each at-rule overwrites the previous pointing to the same output file (Webpack 4) Oct 2, 2019
@zgreen
Copy link
Owner

zgreen commented Oct 3, 2019

Thanks for the bug report, and repo with the replication. It does sound like there's a bug here. I'll take a look as soon as I can; PRs welcome, in the meantime. Cheers.

@bitfella
Copy link
Contributor Author

bitfella commented Oct 4, 2019

@zgreen thanks for your quick reply. Please be aware that @ostowe's own fork should solve this issue. I've tested it locally and everything seems to work fine. Please have a look at his PR #27 :)

Thanks!

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

2 participants