mini-css-extract-plugin icon indicating copy to clipboard operation
mini-css-extract-plugin copied to clipboard

Allow css loaders to specify dependencies on other css files

Open barak007 opened this issue 5 years ago • 5 comments

  • 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

barak007 avatar May 13 '20 10:05 barak007

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?

barak007 avatar May 18 '20 11:05 barak007

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

tomrav avatar Jun 24 '20 13:06 tomrav

@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

alexander-akait avatar Jun 24 '20 13:06 alexander-akait

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.

tomrav avatar Jun 24 '20 13:06 tomrav

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')

alexander-akait avatar Feb 18 '21 16:02 alexander-akait