Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules.mode callback function #1063

Closed
mnpenner opened this issue Mar 29, 2020 · 2 comments · Fixed by #1065
Closed

modules.mode callback function #1063

mnpenner opened this issue Mar 29, 2020 · 2 comments · Fixed by #1065

Comments

@mnpenner
Copy link

mnpenner commented Mar 29, 2020

  • Operating System: Ubuntu 18.04
  • Node Version: v13.11.0
  • NPM Version: 6.13.7
  • webpack Version: 4.42.1
  • css-loader Version: 3.4.2

Feature Proposal

modules.mode can be set to global or local (AFAICT) -- I propose allowing it to take a callback function as well. Callback will be given the full filepath/name which can then return a string, "global" or "local".

Feature Use Case

Projects that were started with existing CSS files will likely need to use "global" mode to avoid having to refactor everything/wrap every file. However, new files/components will probably want to use "local" mode. Being able to turn global/local on for specific directories will make this much easier.

Edit: I suppose if this gets fixed, that'd work too.

@alexander-akait
Copy link
Member

Yep, let's do it, PR welcome

@mnpenner
Copy link
Author

mnpenner commented Apr 7, 2020

Awesome! Thank you very much @cap-Bernardito and @evilebottnawi !

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

Successfully merging a pull request may close this issue.

2 participants