rollup-plugin-bundle-scss
Rollup .scss imports into one bundled .scss file. Supports .vue files.
Maybe you're writing an UI library with SCSS for styles, and you want to bundle all styles in components into one .scss file, so that users can import it and do some custom theming. That's it.
It dependence on scss-bundle.
Installation
npm install -D rollup-plugin-bundle-scss
Usage
import bundleScss from 'rollup-plugin-bundle-scss';
export default {
input: 'src/index.js',
output: {
file: 'dist/index.js',
format: 'esm',
},
plugins: [
bundleScss(),
],
};
Using with rollup-plugin-vue:
import bundleScss from 'rollup-plugin-bundle-scss';
import commonjs from 'rollup-plugin-commonjs';
import vue from 'rollup-plugin-vue';
export default {
input: 'src/App.vue',
output: {
file: 'dist/index.js',
format: 'esm',
},
plugins: [
commonjs(),
bundleScss(),
vue(),
],
};
Using with rollup-plugin-postcss:
import bundleScss from 'rollup-plugin-bundle-scss';
import postcss from 'rollup-plugin-postcss';
export default {
input: 'src/index.js',
output: {
file: 'dist/index.js',
format: 'esm',
},
plugins: [
bundleScss({ exclusive: false }),
postcss({
}),
],
};
API
bundleScss({
output: String,
exclusive: Boolean,
})