Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Allow css loaders to specify dependencies on other css files  #530

Closed

Description

@barak007
  • Operating System: All
  • Node Version: 12
  • NPM Version: All
  • webpack Version: 4
  • mini-css-extract-plugin Version: 0.9.0

Feature Proposal

Allow css loaders to specify dependencies on other css files only for extract sorting purposes.
Right now I consider the behavior a bug since every other loader can use imports to any file.

Feature Use Case

I made a small project to demonstrate the goal and the issue of the current behavior.
All explained in the readme.

https://github.com/barak007/mini-extract-issue

Activity

  1. barak007 commented on May 18, 2020

    @barak007
    Author

    Hi @sokra we are trying to move from our webpack plugin to a more simplified loader that works with other webpack echo system, and will be forward compatible with webpack@5. any chance that you can take a look?

  2. tomrav commented on Jun 24, 2020

    @tomrav

    Hi @evilebottnawi, we'd really appreciate it if you could take a look at this issue, it would help us greatly downstream.

  3. alexander-akait commented on Jun 24, 2020

    @alexander-akait
    Member

    @tomrav @barak007 css-loader and mini-css-extract-plugin in my roadmap on the next month, sorry a lot of work, but I don't forget about it, if you really need this right now, you can send a PoC, if it is will be good written we will merge this ASAP

  4. tomrav commented on Jun 24, 2020

    @tomrav

    Thank you for replying so quickly, I'm not sure we're familiar enough with the required internals to implement this ourselves, perhaps with some guidance we could. Otherwise once you get around to this issue we'd love to help out.

  5. alexander-akait commented on Feb 18, 2021

    @alexander-akait
    Member

    Sorry for delay, problem here you use require('./compA.css') so webpack runs your loader on import again, but you can use require('!!./compA.css')

  6. alexander-akait commented on Jan 10, 2024

    @alexander-akait
    Member

    Closed in favor of #555, also there are some solution:

    1. Use CSS modules to avoid such sutiation (especial composition)
    2. Don't rely on CSS order between modules (it can be unsafe in many situation)
    3. Also you can use @import, but it is still not solve the problem with order between modules

    Also maybe we will provide an option to control it, but the such sulation is not easy to solve, also you can always make a plugin and implement any order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions