Skip to content

Instantly share code, notes, and snippets.

@briancaffey
Created March 20, 2018 02:26
Show Gist options
  • Save briancaffey/169b9edd6d90f464e2d8f1c315417210 to your computer and use it in GitHub Desktop.
Save briancaffey/169b9edd6d90f464e2d8f1c315417210 to your computer and use it in GitHub Desktop.
Enable CSS modules in a create-react-app project

Enable CSS Modules in create-react-app

After running create-react-app project_name, run npm run eject and then add the following lines to webpack.config.dev.js and webpack.config.prod.js:

modules: true,
localIdentName: '[name]__[local]___[hash:base64:5]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment