-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
How to keep both extracted CSS and inline CSS? #120
Comments
Almost the same use case for Chart.js (see chartjs/Chart.js#6015) where we want to be able to provide an option to disable CSS injection for projects with strict CSP policies, which ones should explicitly include the stylesheet instead. So basically, we need something like: postcss({
extract: {
/**
* If `true`, the style will be also included JavaScript side.
* @default false
*/
embed: true
// room for other 'extract' related options ...
path: 'foobar.css',
prefix: 'foobar',
...
}
}) @egoist I will be happy to submit a PR if you agree with integrating that feature. In that case, please let me know how you envision the public API for this new behavior. |
a little janky, but since we can't have [postcss extract and inject styles in one build](egoist/rollup-plugin-postcss#120), split them out to get both. Testing: `index.js` and `.es.js` files have inlined css. local also nextjs app works with `highlight.css` import.
I'm building React component library, and I want 2 output bundle:
Is that possible to extract CSS , while also keep the inline style in output bundle? Thanks for helping me! Great job by you all~
The text was updated successfully, but these errors were encountered: