-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for CSS Modules + Preprocessor #24
Comments
@iansoper this will be implemented soon. |
Is this still on the roadmap to be implemented? |
There's already a pull request for it |
Any news on this? |
@sompylasar You can use this: https://github.com/lewisdiamond/create-react-app/tree/v1.0.1c/packages/react-scripts There's an example in the link I provided. |
@lewisdiamond Thanks. I ended up using https://www.npmjs.com/package/custom-react-scripts-with-modules |
@sompylasar that one is outdated though |
@lewisdiamond Where can I find the sources for https://www.npmjs.com/package/custom-react-scripts-with-modules ? I like the simplicity of "env" variables for commonly used features and not dealing with webpack configs (otherwise how is create-react-app different from a hand-rolled webpack config?), so I'd like to fork it and update with the latest upstream fixes such as https://github.com/facebookincubator/create-react-app/pull/2382/files Why have you decided to go the webpack config route? |
@sompylasar the source was removed. But it's essentially this pull request: #35 I went for the webpack config route to minimize the changes vs CRA and make it easier to pull upstream changes. It really doesn't have to be any different from using the env file. It's only a function that gets an object and returns an object. https://github.com/lewisdiamond/create-react-app/tree/v1.0.7c/packages/react-scripts Just copy the config-helpers and use that. It could be integrated in, but CRA will likely come up with solutions to this soon so I don't want to spend too much time on that. |
That's unfortunate...
Well, one or two lines with flags is different than a function and helpers that I need to copy to every project I bootstrap.
This is exactly what I'm trying to avoid. This doesn't scale. |
@sompylasar make your fork of it and just copy the config helpers in the react-scripts package. It doesn't have to be done for every project. You can also send me a pull request with the config helpers integrated and add a function that adds css modules support. Like I said, I don't want to spend too much time on that since CRA will add support for these things soon. It will probably be JSS. |
@lewisdiamond Thanks. I just didn't want to have / make yet another custom react scripts package in the npm; the "custom" one (not "customizable") with env vars and modules served the best, except it's not up to date and doesn't support typescript (for that there is separate which doesn't support everything else). How can we revive it for the sake of zero-config flag-based features? Maybe you could transfer ownership on npm to me if you're not willing to support it... |
It can be "zero-config" without being strictly flag-based in the env file.
The user interface of customizable-react-scripts/helpers is just more basic right now. You can also fork this repo and add your changes. |
That looks better, as long as the "helpers" are in a published maintained module like yours, not copy-pasted into each of the bootstrapped projects from a README. |
@sompylasar Like I said before, I don't have time to deal with that. You can send me a pull request that integrates them in and I'll merge. My fork wasn't meant to be a general use one, I just posted it to help out. CRA will integrate a better solution directly in their repo soon enough. |
@lewisdiamond Got it, thanks for your support! |
Related:
|
I have finally added this in the latest version. You can have any combination of modules + preprocessor by adding Let me know if it works okay 👌 |
I would like an option that would allow you to use CSS Modules + LESS/SASS preprocessor. The loader example is shown here on the
react-css-modules
repo.https://github.com/gajus/react-css-modules#sass-scss-less-and-other-css-preprocessors
The text was updated successfully, but these errors were encountered: