rollup-plugin-sass
rollup-plugin-sass copied to clipboard
:export for consumption of variables in JavaScript
I try to use the :export construct as described in https://stackoverflow.com/questions/61517117/cannot-export-sass-variables-into-javascript?noredirect=1&lq=1 to be able to use values of SASS variables in my JavaScript but can't get it working:
@import "variables";
:export {
// Export the color palette to make it accessible to JS
some-light-blue: $some-light-blue;
battleship-grey: $battleship-grey;
// etc...
}
Should this work with rollup-plugin-sass, or is there another method to accomplish this?
Struggling with this exact same issue. Did you ever get it resolved?
I'm also looking to see this work.
Hi all, Turns out the plugin supported this all along: Example: https://github.com/elycruz/rollup-plugin-sass/blob/f4b2e6457ed52fb2b4ade58c9853ebf124396980/test/index.test.ts#L290-315
Closing issue as is duplicate of #72 .
Correct example reference: https://github.com/elycruz/rollup-plugin-sass/blob/f4b2e6457ed52fb2b4ade58c9853ebf124396980/test/index.test.ts#L290-L315