-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Webpack plugin for extract #219
Comments
I was looking into this a bit to possibly make my own plugin, but unfortunately it seems like nano-css isn't really statically analyzable, which makes it difficult to put together into a webpack plugin. Looking at the example, the I don't have too much experience with webpack plugins, so perhaps there's another, better way to go about this? |
A "simple" way of achieving it would be:
As a side not, you may not need to "extract" CSS into a separate const html = `
<html>
...
<style>${nano-raw}</style>
...
</html>
`; |
It's quite possible to make one. I made one for Rollup: https://bitbucket.org/TheBosZ/rollup-plugin-nano-css/ |
I've created a loader that does the same thing as my Rollup plugin: https://www.npmjs.com/package/nano-css-loader |
Is there any plugin for Webpack to extract static CSS?
The current solution to extract CSS using Node script is very inconvenient because it cannot be added to Webpack build.
The text was updated successfully, but these errors were encountered: