Skip to content

modules.mode callback function #1063

@mnpenner

Description

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions