Skip to content

Cannot both control generateScopedName and use posstcss plugins. #37

Closed
@pekim

Description

@pekim

The return in https://github.com/css-modules/css-modules-require-hook/blob/master/src/index.js#L58 means that the generateScopedName option is ignored when postcss plugins are configured (with use).

It looks like #34 was intended to address this, but as far as I can tell it doesn't. The return statement continues to be a problem.

Replacing

  if (customPlugins) {
    return void (plugins = customPlugins);
  }

  plugins = [];

with

  if (customPlugins) {
    plugins = customPlugins;
  } else {
    plugins = [];
  }

(or at least hacking in the equivalent in dist) works for me. I'm not sure if it would break any other use cases.

I have a feeling that I may be simply overlooking or misunderstanding something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions