Skip to content
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

Support CSSModules for SASS. #21

Closed
stereobooster opened this issue Oct 7, 2016 · 4 comments
Closed

Support CSSModules for SASS. #21

stereobooster opened this issue Oct 7, 2016 · 4 comments

Comments

@stereobooster
Copy link

I need this feature to have out of the box integration with react-toolbox. See react-toolbox/react-toolbox-example#35

The question is if we have:

REACT_APP_SASS=true
REACT_APP_CSS_MODULES=true

Does it always mean we want CSSModules for SASS? I suppose yes

@claylevering
Copy link

+1 to this, I just ran into this and was thinking about possibly contributing code but I'm not the world's best CSS Modules expert... perhaps I'll look at it tonight.

@stereobooster
Copy link
Author

stereobooster commented Oct 7, 2016

Solution is simple, question is how to integrate it

  'SASS': {
    toArray: 'loaders',
    getDev: function () {
      return {
        test: /(\.scss|\.sass)$/,
        loader: "style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss"
      }
    },
    getProd: function () {
      return {
        test: /(\.scss|\.sass)$/,
        loader: ExtractTextPlugin.extract('style', 'css?modules&-autoprefixer&importLoaders=1!postcss')
      }
    }
  },

@claylevering
Copy link

@stereobooster - Does that seem to work?

@stereobooster
Copy link
Author

Created PR so closing issue. #23

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

No branches or pull requests

2 participants