-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Adds .scss support with sass-loader, node-sass, and a simple webpack config edit. #115
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
There is sort of a paradox here. If this project accepts all extra file formats like scss, it will become bloated, and everyone will want to eject so that they can slim things down by removing all the things they don't use. Yet each individual one doesn't seem that bad. It feels to me like we need some philosophy on what features to install by default beyond "it is a useful feature to some people". |
Hi Juwan, thanks for PR! We would like to know which features specifically you find useful in React apps, and why. In my experience, Less/SASS don’t add much to React projects because features like nesting are much less necessary thanks to the component model. Please add your feedback in #78 to let us know which features you are missing with React + regular CSS, and we might revisit this decision later. Thanks! |
@gaearon What if I use css framework and want to customize it's styles via SASS variables (see bootstrap)? You assume that developers will either write their own css which they are in total control of or plug in the complete package like React Bootstrap which is not always the case. I understand why you're reluctant to include SASS support, but with it quickly becoming an industry standard this issue shouldn't be dismissed easily. |
@adiachenko you can just SASS has been around for several years but I've not seen it becomes industry standard. When it really becomes, then you won't need to use The purpose of I prefer the current state of |
Hi @adiachenko , there are ways to use Sass with Create React App without ejecting, please see here: #1008 You can also fork React scripts to add Sass yourself, please see #779 |
@petehouston I see your point. It's just that for now as much as I like create-react-app I am reluctant to use it in way other than a cheetsheet of common practices when I need to eject for such a simple reason. I am not sure adding sass-loader by default would be the best way to address the issue considering the plethora of potential node-gyp issues, but I think it should have gotten more care than simply dismissing the problen under the pretext of being outside of scope of React. I mean, I don't want to see create-react-app becoming a black box that is used by newcomers to build todo lists. Being officialy supported, this project has plenty of potential for more. @dvkndn thanks, I've seen that pull request, but it looks a bit ugly and will result in errors in some environments (try running that in powershell). Forking, though, seems like a way to go for now. |
@adiachenko I know you've fallen in love with |
Hi @adiachenko , Regarding the SASS approach in that PR, you will need some changes in the command if you don't run it in Unix enviroment, specifically the "&&" syntax (which chains commands). The idea here is to run a watch for your SASS and use node-sass to compile it, without concerning Create React App. Anyway, I think forking is a good solution for medium to large project. I'm currently using a fork of react-scripts for our company primary products. It is quite stable and a lot better than when we need to build and maintain a build setup ourselves previously. So.. Create React App might not fit for big projects, but a fork will be. After all, they are just build setup.. |
Most web developers who use Bootstrap v4 need to be able to make changes to Bootstrap _variables.scss. |
Update tsconfig to support dynamic import
A simple feature I enjoyed when I was helping with and using enclave. Edited the template to ensure that it worked.