Skip to content

Commit

Permalink
fix: use webpack for dev-server to keep consistent css-module classnames
Browse files Browse the repository at this point in the history
There's an inconsistency between webpack and next turbo's `localIdentName`

This also improves the hot-loading

fixes AOEpeople#440
  • Loading branch information
mathiasschopmans committed Mar 25, 2024
1 parent a8172e6 commit 335ecf6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ with a specified value. As an example, if you want to always show the subline in
the following rule:

```css
[class^="subline__Logo"] {
[class^="Logo_subline"] {
display: block;
opacity: 1;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"techradar": "./bin/techradar.js"
},
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"build:icons": "npx @svgr/cli --typescript --no-dimensions --no-prettier --out-dir src/components/Icons -- src/icons",
"build:data": "tsx scripts/buildData.ts",
"build": "next build",
Expand Down
36 changes: 15 additions & 21 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
module.exports = {
plugins:
process.env.NODE_ENV === "production"
? [
"postcss-nested",
[
"postcss-preset-env",
{
autoprefixer: {
flexbox: "no-2009",
},
stage: 3,
features: {
"custom-properties": false,
},
},
],
]
: [
// No transformations in development
// because it won't affect turbo
],
plugins: [
"postcss-nested",
[
"postcss-preset-env",
{
autoprefixer: {
flexbox: "no-2009",
},
stage: 3,
features: {
"custom-properties": false,
},
},
],
],
};

0 comments on commit 335ecf6

Please sign in to comment.