Git Product home page Git Product logo

Comments (14)

Anidetrix avatar Anidetrix commented on July 27, 2024 3

@n370 @himself65 this change breaks such plugins as postcss-import, cause imported classes won't be modularized

from rollup-plugin-postcss.

Anidetrix avatar Anidetrix commented on July 27, 2024 1

@n370 probably with something like SugarSS

from rollup-plugin-postcss.

pascalduez avatar pascalduez commented on July 27, 2024 1

The issue is still alive: [email protected]

from rollup-plugin-postcss.

pascalduez avatar pascalduez commented on July 27, 2024

Ok, narrowed to madyankin/postcss-modules/issues/70

from rollup-plugin-postcss.

pascalduez avatar pascalduez commented on July 27, 2024

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.

peter-mouland avatar peter-mouland commented on July 27, 2024

I ran into this issue today, was there a fix for this?

from rollup-plugin-postcss.

n370 avatar n370 commented on July 27, 2024

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.

n370 avatar n370 commented on July 27, 2024

@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.

Anidetrix avatar Anidetrix commented on July 27, 2024

@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.

n370 avatar n370 commented on July 27, 2024

@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.

n370 avatar n370 commented on July 27, 2024

got you!

from rollup-plugin-postcss.

egoist avatar egoist commented on July 27, 2024

๐ŸŽ‰ This issue has been resolved in version 2.4.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

from rollup-plugin-postcss.

danny-andrews avatar danny-andrews commented on July 27, 2024

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.

danny-andrews avatar danny-andrews commented on July 27, 2024

This particular issue is a dupe of #26.

from rollup-plugin-postcss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.