Comments (14)
@n370 @himself65 this change breaks such plugins as postcss-import, cause imported classes won't be modularized
from rollup-plugin-postcss.
@n370 probably with something like SugarSS
from rollup-plugin-postcss.
The issue is still alive: [email protected]
from rollup-plugin-postcss.
Ok, narrowed to madyankin/postcss-modules/issues/70
from rollup-plugin-postcss.
Also using CSS modules composition could result in a bunch of duplicate rules.
/* Shared.css */
.test {
content: 'test';
}
/* Foo.css */
.foo {
composes: test from './Shared.css';
}
/* Bar.css */
.bar {
composes: test from './Shared.css';
}
Result:
.Shared-test {
content: 'test';
}
.Foo-foo {}
.Shared-test {
content: 'test';
}
.Bar-bar {}
from rollup-plugin-postcss.
I ran into this issue today, was there a fix for this?
from rollup-plugin-postcss.
I found that changing https://github.com/egoist/rollup-plugin-postcss/blob/master/src/postcss-loader.js#L75 from push
to unshift
fixes the issue.
from rollup-plugin-postcss.
@Anidetrix yeah, you're right. We need to find a better solution. One easy solution I can think of is to maybe add a hardcoded list of plugin names that need to be loaded before postcss-modules and then split the user provided list of plugins into a list of plugins to be loaded before postcss-modules and a list to be loaded after. But really that's my naive take since I have just a small experience with the codebase.
from rollup-plugin-postcss.
@n370 This is due to the fact that postcss-modules calls PostCSS inside itself, thus causing the doubling. The proper solution is to adapt separate PostCSS plugins for modules as it is done in webpack's css-loader.
from rollup-plugin-postcss.
@Anidetrix I haven't observed that behavior in my use case but that might be the case. Anyways, I was thinking about why one would want to use the postcss-import plugin when they already have sass, less and stylus built in.
from rollup-plugin-postcss.
got you!
from rollup-plugin-postcss.
๐ This issue has been resolved in version 2.4.1 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
from rollup-plugin-postcss.
Can confirm, I still see this issue on 3.1.8.
When I use composes: classname from "./some-module.js"
, I end up with that rule definition being duplicated in the css output.
from rollup-plugin-postcss.
This particular issue is a dupe of #26.
from rollup-plugin-postcss.
Related Issues (20)
- postcss/lib/processor.es6:139:15
- Not working with scss modules including inline comments
- React npm packages using rollup not working with srr or nextjs? HOT 5
- Usage of "~" sign in imports
- [scss] Sources path in extracted "*.map.css" file is not correct - hierarchy of folders is missed. HOT 1
- Error thrown "@use rules must be written before any other rules." HOT 1
- No option to generate moduler css along with one single css which will load separately into dom
- Question: Is there a way to add attributes to the <style> tag generated? HOT 1
- Customize `less` instance
- Is it possible to set stylesheet order?
- On watch mode generated CSS sometimes is prepended when using multiple CSS files
- Sourcemap file points to the compiled scss when its setting is `true`
- Bundle webcomponent.js with webcomponent.css
- ็ผ่ฏcssๆไปถๅคฑ่ดฅ HOT 3
- How to use only dart(sass) without node-sass
- Nextjs support: The server side rendering of components is making it unstyled. HOT 3
- Can't use mjs config files HOT 2
- Move to `postcss-load-config` 5.0
- Cannot convert deep syntax in Vue HOT 2
- ES module support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rollup-plugin-postcss.