Plugins run twice on css modules
See original GitHub issueHi,
I’m still investigating the issue but wanted some feedback:
postcss({
modules: true,
extract: true,
plugins: [
require('postcss-custom-properties')({ preserve: true })
],
})
Result:
.Button_primary__1gH9y {
color: green;
color: green;
color: var(--color-primary);
}
I did some logging and the postcss-custom-properties
is run twice on the same css module, hence the duplicate fallback.
1st
.primary {
color: var(--color-primary);
}
2nd
.Button_primary__1gH9y {
color: green;
color: var(--color-primary);
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Sass files compiling twice - webpack - Stack Overflow
1 Answer 1 ... It's MiniCssExtractPlugin running sass-loader twice. Not sure why. Share. Share a link to this answer.
Read more >Plugins - webpack
A webpack plugin is a JavaScript object that has an apply method. This apply method is called by the webpack compiler, giving access...
Read more >Using webpack with TypeScript - LogRocket Blog
js file, import the MiniCssExtractPlugin module using the code below: const MiniCssExtractPlugin = require("mini-css-extract-plugin");. Then, we ...
Read more >Custom Webpack Config - Next.js
The webpack function is executed twice, once for the server and once for the client. This allows you to distinguish between client and...
Read more >Parcel
parcel index.html Server running at http://localhost:1234 Build failed. ... If you use CSS modules, unused classes will be removed automatically.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@n370 @Himself65 this change breaks such plugins as postcss-import, cause imported classes won’t be modularized
The issue is still alive:
rollup-plugin-postcss@3.1.4