Skip to content

Commit

Permalink
fix: css modules not working in production
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Aug 22, 2020
1 parent 9f19d1b commit 3f232b5
Show file tree
Hide file tree
Showing 3 changed files with 323 additions and 396 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@babel/register": "^7.10.5",
"@dr.pogodin/css-modules-require-hook": "^4.4.0",
"@hot-loader/react-dom": "^16.13.0",
"@loadable/babel-plugin": "^5.13.0",
"@loadable/component": "^5.13.1",
Expand All @@ -97,7 +98,6 @@
"connected-react-router": "^6.8.0",
"core-js": "^3.6.5",
"cross-env": "^7.0.2",
"css-modules-require-hook": "^4.2.3",
"eslint-plugin-react-hooks": "^4",
"express": "^4.17.1",
"helmet": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion tools/webpack/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const isDev = nodeEnv === "development";

module.exports = () => {
// CSS modules
require("css-modules-require-hook")({
require("@dr.pogodin/css-modules-require-hook")({
// Must use the same pattern with your webpack config
generateScopedName: isDev ? "[name]__[local]" : "[hash:base64:5]",
extensions: [".css", ".scss", ".sass"],
Expand Down
Loading

0 comments on commit 3f232b5

Please sign in to comment.