Skip to content

fix(loader): Correctly preserve CSS module locals #9

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

Merged
merged 1 commit into from
Mar 5, 2018

Conversation

Jessidhia
Copy link
Contributor

The handling was there, but the property it tried to access was being clobbered by the .map's result.

The handling was there, but the property it tried to access was being clobbered by the .map's result.
@sokra sokra merged commit 3f850db into webpack-contrib:master Mar 5, 2018
@sokra
Copy link
Member

sokra commented Mar 5, 2018

Thanks

@sylver
Copy link
Contributor

sylver commented Apr 17, 2018

Same issue, the finale css file is populated with classes, as expected, but my class attributes are empty everywhere I use one of these classes. This isn't fixed.

I went back to use [email protected] which works as expected.

@alexander-akait
Copy link
Member

@Onelin @Sylv3r can you create minimum reproducible test repo? Also please create new issue. Thanks!

@sylver
Copy link
Contributor

sylver commented Apr 17, 2018

@evilebottnawi @Onelin I actually found the solution while trying to prepare the MRE..

One needs to switch between style-loader and MiniCssExtractPlugin.loader as the first loader used by the rule depending on the env (ie. development for HMR or production for dist builds) since this plugin is not HMR ready, yet.

Short example (without loaders options) :

{
  test: /\.s?[ac]ss$/,
  use: [
    NODE_ENV === 'production' ? MiniCssExtractPlugin.loader : 'style-loader',
    'css-loader',
    'postcss-loader',
    'sass-loader',
  ],
}

I think this should be explained in the docs since this is a bit tricky.

@alexander-akait
Copy link
Member

@Sylv3r Can you do PR?

@sylver
Copy link
Contributor

sylver commented Apr 17, 2018

Sure, have a look at #101 @evilebottnawi

@Onelin
Copy link

Onelin commented Apr 24, 2018

I solved my problem by using the MiniCssExtractPlugin in the use:[], but not using the 'style-loader' in front of it, causing a conflict. Tks

hdnha11 added a commit to hdnha11/react-redux-sharing that referenced this pull request May 8, 2018
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.

5 participants