@billogram/rollup-plugin-style
Extract styles and write it to separate file
Extracts SCSS and CSS using node-sass
and postcss
with autoprefixer
and cssnano
.
Install
yarn add --exact @billogram/rollup-plugin-style
Usage
Include it as a plugin in your rollup.config.js
.
import rollupPluginStyle from '@billogram/rollup-plugin-style';
module.exports = {
// ...
plugins: [
rollupPluginStyle({
filename: 'index.css',
shouldGenerate: true,
shouldInjectImport: false,
}),
],
};
The following options are available:
-
filename
(defaultindex.css
): the filename of generated CSS bundle. -
shouldGenerate
(default:true
): a boolean value indicating whether to generate a CSS bundle. Style imports are ignored if set tofalse
. -
shouldInjectImport
(default:false
): a boolean value indicating whether to inject an import statement for the CSS bundle in the JavaScript bundle.
Note
This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. We probably won't take your feature requests unless they align with our own needs.
License
MIT