Uh oh!
There was an error while loading. Please reload this page.
Sass loader - #4195
Conversation
facebook-github-bot
commented
Mar 21, 2018
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. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
facebook-github-bot
commented
Mar 21, 2018
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
andriijas
commented
Mar 22, 2018
Great work! We are adding a lot of config which is very similar to .css and .module.css can we make a function that removes some duplication? If we make such a function it should be a breeze to support both less, less modules, scss, scss modules, css and css modules. they all have more or less equivalent config. |
| minimize: true, | ||
| sourceMap: shouldUseSourceMap, | ||
| modules: true, | ||
| localIdentName: '[path]__[name]___[local]', |
There was a problem hiding this comment.
We should use react-dev-utils/getCSSModuleLocalIdent when #4192 is merged.
gaearon
commented
Mar 24, 2018
Can somebody also take over webpack/sass-loader#533 since @Timer is busy with other things? |
Fabianopb
commented
Mar 24, 2018
@andriijas, that's a good point, I've abstracted the common options in the style loaders to a function, PR updated. |
Timer
commented
Mar 25, 2018
I have updated webpack/sass-loader#533 and it should now be merge-ready. |
Fabianopb
commented
Mar 29, 2018
@andriijas, I got the unit and integration tests working a couple days ago, I guess now it's just waiting for webpack/sass-loader#533 and #4192 |
iansu
commented
Apr 18, 2018
Thanks @Fabianopb and everyone else who helped out! |
Fabianopb
commented
Apr 18, 2018
Thank you all, what a journey! 😄 |
gaearon
commented
Apr 18, 2018
Wow |
Tasemu
commented
Apr 19, 2018
Excellento! |
miraage
commented
Apr 21, 2018
@Fabianopb@Timer@gaearon what do you think about providing an option to configure sass? We love using |
Timer
commented
Apr 21, 2018
@miraage I don't believe so, unless you can show some really compelling reasons and we can come up with a sensible default. This would fall under the same reasoning we don't allow you to set webpack aliases/etc. |
@Timer, I find it useful to keep variables/mixins somewhere in |
* upstream/next: (35 commits) Update envinfo and issue template (react#4375) Update sass-loader to 7.0.1 (react#4376) Support package distribution tags (react#4350) fix broken css module support in prod (react#4361) Bumped jest version to 22.4.1 (react#4362) bump babel 7 to beta 46 bump lint-staged to node 10 compatible version documentation: Added License to the README.md (react#4294) Bump `fsevents`. (react#4331) Fix typo in e2e-simple.sh comment (react#4323) Add Sass loader (react#4195) Fix some typos in README.md (react#4286) Added learnstorybook.com to Storybook links (react#4298) Document multiple build environments via `env-cmd` react#4071 (react#4117) Fixed link to CSS imports blog post Update CSS Modules localIndetName (react#4192) Enable loose mode for `class-properties` (react#4248) bump babel 7 beta (react#4253) Small typo fixreact#4217 Changelog for 1.1.4 ...
* next: (35 commits) Update envinfo and issue template (react#4375) Update sass-loader to 7.0.1 (react#4376) Support package distribution tags (react#4350) fix broken css module support in prod (react#4361) Bumped jest version to 22.4.1 (react#4362) bump babel 7 to beta 46 bump lint-staged to node 10 compatible version documentation: Added License to the README.md (react#4294) Bump `fsevents`. (react#4331) Fix typo in e2e-simple.sh comment (react#4323) Add Sass loader (react#4195) Fix some typos in README.md (react#4286) Added learnstorybook.com to Storybook links (react#4298) Document multiple build environments via `env-cmd` react#4071 (react#4117) Fixed link to CSS imports blog post Update CSS Modules localIndetName (react#4192) Enable loose mode for `class-properties` (react#4248) bump babel 7 beta (react#4253) Small typo fixreact#4217 Changelog for 1.1.4 ...
lukaszgolder
commented
May 12, 2018
@Timer Maybe instead of providing possibility to configure sass you can include NODE_PATH in the It would be something like this: |
Timer
commented
May 12, 2018
Can you please open an issue for this @lukaszgolder? Thanks! |
When shall this be merged with master? |
bugzpodder
commented
May 22, 2018
Hey devxpy, this will be released as part of CRA 2.0 and we don't yet have a definitive timeline. To try out the alpha build, please follow instructions on #3815 |
terebentina
commented
May 24, 2018
Just upgraded cra 1 to cra2 on an existing project and sass support seems to require Also, on a different topic: the docs for 1.x suggest to use |
samuelcolvin
commented
May 24, 2018
see #2498 (comment) I think, the agreement was that users need to manually install |
Fabianopb
commented
May 24, 2018
Yes @terebentina, |
jimbojetlag
commented
Jun 20, 2018
@Timer please see #4651 where it is explains that npm packages importing other npm packages depend on the It does not make sense that you require users of CRA to manually install node-sass, yet you do not allow any options for custom sass paths, while not providing sane defaults. I do not see how the users can shoot themselves in the foot if you expose that option. As many users have already suggested, there is nothing wrong with using Relying on sass-loader for this simple config may not be a good idea, the devs of sass-loader have been keep moving back and forth between webpack and sass for this config, causing regressions. It is sad to see that the javascript community keeps breaking what works perfectly. |
@jimbojetlag I have a project, react-pages which let's you do this using the NODE_PATH env variable (Enabled by default using |
jarretmoses
commented
Jul 2, 2018
I am probably missing something but could someone explain how CRA will be initialized with SASS support? (ie what’s the cli command) |
jarretmoses
commented
Jul 2, 2018
@matgargano thanks for this but I meant how to use ‘sass-loader’ rather than the approach detailed in the docs. (node-sass-chokidar). I know I can just eject but this PR seems to say this will be a built in feature. |
matgargano
commented
Jul 2, 2018
@jarretmoses what are you trying to accomplish that that URL does not provide a way to do? |
@jarretmoses if you install the beta ( Please open an issue if you need any more assistance. |
Opt-in support for SASS and CSS-modules using SASS files added, using both .scss and .sass extensions.
This PR:
sass-loaderin the react-scripts package~No automated test just yet (coming in a couple days)! However I've manually tried the e2e flow using both scss and sass extensions, with or without modules, and it worked just fine.~~
edit: ✅ Unit and integration tests added!
This PR depends on webpack/sass-loader#533 to work properly. ✅ Merged and integrated!I'll be happy to get comments! :)
edit: @andriijas mentioned that we should use react-dev-utils/getCSSModuleLocalIdent when #4192 is merged, for the. ✅ Merged and integrated!localIdentName