Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

SASS Support #2

Closed
ido-ran opened this issue Sep 25, 2016 · 2 comments
Closed

SASS Support #2

ido-ran opened this issue Sep 25, 2016 · 2 comments

Comments

@ido-ran
Copy link

ido-ran commented Sep 25, 2016

I'm trying to use your starter kit to build a React lib, one thing that is missing is to be able to build the lib with SASS and have the build process generate browser-ready CSS files.

@frostney
Copy link
Owner

frostney commented Oct 1, 2016

Hi @ido-ran, thank you for creating an issue. I may be wrong and please correct if I am, but I feel having SASS support is a very specific use case, and not every React library will have a style component to it. If SASS support were to be part of the starterkit, the next thing would be to support LESS, then other preprocessors, CSS Modules or specific inline style toolkits. This is a can of worms in my eyes and it would be quite hard for me to maintain all these eventualities.

The easiest thing for you in your use case would to add another command to be built in npm run build, in this case generating SASS files. You could try having something like "npm run build": "rollup-babel-lib-bundler src/index.js && node-sass src/mystyles.scss dist/mystyles.css" and add node-sass as a devDependency.

If your SASS files are required inside your JavaScript you would need to pass a plugin into rollup-babel-lib-bundler, and while I haven't tried this myself yet, https://github.com/differui/rollup-plugin-sass may be what you are looking for.

@frostney frostney closed this as completed Oct 1, 2016
@ido-ran
Copy link
Author

ido-ran commented Oct 2, 2016

Hi,
I agree that this is a can of worms simple because of the shere number of tools/plugins/formats.
It will be valuable, if you have the time, to show how to both produce and consume css as it is vital part of almost any web library.
The problem I found is that there is no clear way nor best practice for producing web-library that expose css as well as js.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants