rollup-plugin-collect-sass
rollup-plugin-collect-sass copied to clipboard
Providing bundled .scss/.sass
Hello!
I apologize if this isn't the right place to ask this question, please let me know if this is more a node-sass issue.
I was wondering if it would be possible to output a bundled, deduped .scss/.sass file, pre-compile down to .css. Building a component library I feel it'd be super nice to provide a way for consumers to import CSS but also a way to import SASS and not lose the language's power.
Thanks!
Yes indeed, this is the exact use case for this plugin.
On second read, is your goal a bundled .scss file or a .css file? The library currently produces css.
Yah, it's a bundled .scss, the first of the two processes described in the readme. Does the library's processing make this an easy addition? If I were to jump in and make a PR? Assuming this ability sounds useful ;)
Yeah, the line of code is here: index.js#L185. The accum variable contains the scss as a string. It could check an option and set the cssExtract variable instead of css: index.js#L203.