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

CSS Modules generateScopedName override #2865

Conversation

EvilHacker
Copy link

@EvilHacker EvilHacker commented Mar 28, 2019

Allow the CSS Modules generateScopedName option to be overridden in a configuration file ('.postcssrc', '.postcssrc.json', '.postcssrc.js', or 'postcss.config.js').

Close #2922
Fix #972

@lpython
Copy link

lpython commented Mar 31, 2019

Just commented on #972 , I had to switch postcss.js : lines 55 / 56 to get the expected behavior. I didn't touch lines 47-48.

@kidandcat
Copy link
Contributor

Waiting for this to be merged

@EvilHacker
Copy link
Author

Anyone know what the next step is to get this merged or to get feedback?

@kidandcat
Copy link
Contributor

kidandcat commented Apr 8, 2019

I just forked it. It's a showstopper for us.

@kidandcat
Copy link
Contributor

@EvilHacker why did you changed lines 47-48 and then added:

  Object.assign(postcssModulesConfig, {
    getJSON: (filename, json) => (asset.cssModules = json),
    Loader: createLoader(asset)
  })

The bug is fixed by just swapping lines 55-56

@EvilHacker
Copy link
Author

@kidandcat To reply to your question...

I wanted to make minimal changes to the existing behavior and ONLY add the ability to override the generateScopedName option.

There may have been some other rationale (that I am not aware of) for the changes that inadvertently caused this bug. Maybe it is that Parcel wouldn't work if the user could also override the getJSON and/or Loader options?

I was being conservative in trying to not modify previous behavior in case it was intentional.

@EvilHacker
Copy link
Author

@kidandcat I see your simple line-swap fix in pull request for #2922 .
One of our pull requests is redundant. I'm fine either way this issue is resolved.

@kidandcat
Copy link
Contributor

I'm fine too with any of the fixes, just want this to be fixed ASAP. (I'm not against your change, but trying to make pressure)

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

Successfully merging this pull request may close these issues.

BUG: postcss module generates wrong hashes
4 participants