-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
CSS modules: remove unused classes #5363
Changes from 9 commits
af30190
3c6e349
fa6df9f
07d1da4
ebc7673
0bba658
0efffeb
faa032a
4c693b0
b378511
b7afd9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,14 +34,14 @@ | |
"lodash": "^4.17.15", | ||
"marked": "^0.6.1", | ||
"ncp": "^2.0.0", | ||
"parcel": "2.0.0-beta.1", | ||
"parcel-bundler": "2.0.0-beta.1", | ||
"postcss": "^8.0.0", | ||
"parcel": "2.0.0-beta.1", | ||
"postcss-custom-properties": "^8.0.9", | ||
"postcss-import": "^12.0.1", | ||
"postcss-import": "^13.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One interesting situation that I ran into was that the old postcss-import version didn't use PostCSS 8 and inserted nodes into the AST that were missing some methods from recent my PostCSS PR ( |
||
"postcss": "^8.2.1", | ||
"posthtml-obfuscate": "^0.1.5", | ||
"react": "^16.11.0", | ||
"react-dom": "^16.11.0", | ||
"react": "^16.11.0", | ||
"rimraf": "^2.6.1", | ||
"tempy": "^0.3.0", | ||
"ws": "^7.0.0" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
const postcss = require('postcss'); | ||
|
||
module.exports = postcss.plugin('postcss-test', () => (css, result) => { | ||
css.walkRules(rule => { | ||
rule.each(decl => { | ||
if (decl.value === 'red') { | ||
decl.value = 'green'; | ||
} | ||
}); | ||
}); | ||
}); | ||
module.exports = (opts = {}) => { | ||
return { | ||
postcssPlugin: 'postcss-test', | ||
Once(root, {result}) { | ||
root.walkRules((rule) => { | ||
rule.each((decl) => { | ||
if (decl.value === 'red') { | ||
decl.value = 'green'; | ||
} | ||
}); | ||
}); | ||
}, | ||
}; | ||
}; | ||
module.exports.postcss = true; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import styles from "./style.module.css"; | ||
|
||
output = styles["b-2"]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.unused { | ||
color: red; | ||
} | ||
|
||
.b-2 { | ||
font-size: 12pt; | ||
} | ||
|
||
:global(.page) { | ||
border: 1px solid black; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background: blue; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import "./global.css"; | ||
import * as styles from "./style.module.css"; | ||
|
||
output = styles["b-2"]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.unused { | ||
color: red; | ||
} | ||
|
||
.b-2 { | ||
font-size: 12pt; | ||
} | ||
|
||
:global(.page) { | ||
border: 1px solid black; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬