A Rollup plugin that transforms .scss.js files generated by rollup-plugin-postcss in inject mode into .css files, enabling proper CSS file imports for on-demand component loading. Currently at v1.0.2, it was last updated in 2021 and appears to be in maintenance mode with no recent commits. It solely depends on rollup-plugin-postcss and is designed for scenarios where `preserveModules` and `babel-plugin-import` are used for component-level code splitting, solving the issue of conflicting style weights between inline <style> tags and <link> imports. Not actively maintained; limited documentation and niche use case.
npm install rollup-plugin-postcss-inject-to-cssVerified import paths — ran on the pinned version, not inferred.
Configures Rollup to use rollup-plugin-postcss in inject mode and then transforms the generated .scss.js files into .css files for on-demand loading.
Ensure rollup-plugin-postcss-inject-to-css is listed after rollup-plugin-postcss in the plugins array.
Set rollup-plugin-postcss options: { inject: true, extract: false }.Consider alternative approaches or fork the plugin to update dependencies.
Run 'npm install -D rollup-plugin-postcss-inject-to-css' or use correct import path.
Use default import: import injectToCss from 'rollup-plugin-postcss-inject-to-css'
Call the default export as a function in plugins array: plugins: [postcss({...}), injectToCss()]