create-react-library
create-react-library copied to clipboard
Export plain SCSS files
Hi there!
I'm using the SCSS in my components library, and willing to export it with the build so I can reuse the SCCS in the main app
Is it possible? I have been looking into the microbundle
and create-react-library
docs, but no success
Ok, it is possible by setting two props in package.json
//....
"style": "src/scss/core.scss",
//....
"files": [
"dist",
"src/scss" // add this
],
//....
Now the src/scss
folder with all files will be a part of the package version that is installed into node_modules
Then in the project, where you want to import SCSS do it with
@import "pacakge-name/src/scss/core.scss"; // in my particular case
For Create React App no need to add ~
prefix for package SCSS import
Thanks for the great tool, @transitive-bullshit!