Skip to content

Commit 2d65854

Browse files
committed
Fix issue with babel-plugin-react-css-modules and css-loader compatability
gajus/babel-plugin-react-css-modules#291
1 parent b175cb7 commit 2d65854

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

babel.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const genericNames = require('generic-names');
12
const path = require('path');
23

34
const CSS_MODULE_LOCAL_IDENT_NAME = '[local]___[hash:base64:5]';
@@ -56,7 +57,7 @@ module.exports = (api) => {
5657
[
5758
'react-css-modules',
5859
{
59-
generateScopedName: CSS_MODULE_LOCAL_IDENT_NAME,
60+
generateScopedName: genericNames(CSS_MODULE_LOCAL_IDENT_NAME),
6061
filetypes: {
6162
'.scss': {
6263
plugins: ['postcss-nested'],

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"env-cmd": "^10.1.0",
3535
"express": "^4.17.1",
3636
"express-session": "^1.17.1",
37+
"generic-names": "^3.0.0",
3738
"history": "^5.0.0",
3839
"http-proxy": "^1.18.1",
3940
"humps": "^2.0.1",

yarn.lock

+7
Original file line numberDiff line numberDiff line change
@@ -4258,6 +4258,13 @@ generic-names@^2.0.1:
42584258
dependencies:
42594259
loader-utils "^1.1.0"
42604260

4261+
generic-names@^3.0.0:
4262+
version "3.0.0"
4263+
resolved "https://registry.yarnpkg.com/generic-names/-/generic-names-3.0.0.tgz#c69a01700098e1215d5a0b820ac21ddd70a78dbb"
4264+
integrity sha512-4zZck5fpODoHpbiPaQqwhSWKk+dxHeCL7U1UpQsYwl9w5iNU4+K6uBHifOe7e0FCOuKMUiGUXxwJdsqHZBCVew==
4265+
dependencies:
4266+
loader-utils "^2.0.0"
4267+
42614268
gensync@^1.0.0-beta.2:
42624269
version "1.0.0-beta.2"
42634270
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"

0 commit comments

Comments
 (0)