rollup-plugin-collect-sass icon indicating copy to clipboard operation
rollup-plugin-collect-sass copied to clipboard

Providing bundled .scss/.sass

Open yoiang opened this issue 8 years ago • 4 comments
trafficstars

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!

yoiang avatar Oct 27 '17 01:10 yoiang

Yes indeed, this is the exact use case for this plugin.

nathancahill avatar Oct 27 '17 01:10 nathancahill

On second read, is your goal a bundled .scss file or a .css file? The library currently produces css.

nathancahill avatar Oct 27 '17 01:10 nathancahill

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 ;)

yoiang avatar Oct 27 '17 03:10 yoiang

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.

nathancahill avatar Oct 27 '17 04:10 nathancahill