You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
importbundleScssfrom'rollup-plugin-bundle-scss';importcommonjsfrom'rollup-plugin-commonjs';importvuefrom'rollup-plugin-vue';exportdefault{input: 'src/App.vue',output: {file: 'dist/index.js',format: 'esm',},plugins: [// required by rollup-plugin-vuecommonjs(),// put it before vue()bundleScss(),vue(),],};
importbundleScssfrom'rollup-plugin-bundle-scss';importvuefrom'rollup-plugin-vue';exportdefault{input: 'src/App.vue',output: {file: 'dist/index.js',format: 'esm',},plugins: [vue(),// put it after vue()bundleScss(),],};
importbundleScssfrom'rollup-plugin-bundle-scss';importpostcssfrom'rollup-plugin-postcss';exportdefault{input: 'src/index.js',output: {file: 'dist/index.js',format: 'esm',},plugins: [// put it before postcss(), and set exclusive to falsebundleScss({exclusive: false}),postcss({// ...}),],};
API
bundleScss({// where to output bundled SCSS fileoutput: String,// Whether SCSS file is exclusive to rollup-plugin-bundle-scss.// Defalut value: true// Set it to false when there're other plugin to handle SCSS file after bundleScss()exclusive: Boolean,// bundlerOptions will be passed into `scss-bundle` package,// see document here https://github.com/reactway/scss-bundlebundlerOptions: {// If tilde import is used, `project` is required for finding `node_modules`project: String,dedupeGlobs: String[],includePaths: String[],ignoreImports: String[],},})