-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Missing [path] in module.less files [webpack 4] #165
Comments
Same here. Also seems like the hash part doesn't match as well anymore. |
This is an example of what I have: The hashes are not matching |
I have not switched to webpack v4 myself. Cannot comment. Ensure that Assuming this is incompatibility with v4, then PR is welcome. |
@gajus I'm not sure how to configure the context in the .babelrc, Can you provide a demo ? Thanks. |
https://github.com/gajus/babel-plugin-react-css-modules/blob/master/demo/webpack.config.js#L28 |
It's said the context is only to configure in the |
You need to configure context in webpack and Babel. How you configure Babel is up to you (you can use |
Thanks for explaining. It seems there is bug using webpack4. I've configured the context in the webpack. Howver the xx_xx_xxxxx can't be found in the <style>. <div class='xx_xx_xxxxx'>
123
</div>; |
I got the same error. It seems that there isn't a bug of webpack4. It happens when the webpack config files and babel configuration files are in different directories. Maybe you can console.log and compare them :) |
For anybody else stuck with same issue!You most likely use css-loader ^4, hashes are different because of that. css-loader ^4 uses md4 for a hash, but this package uses md5. Now for the solution: Original developer of this package seems to have abandoned further development, however @birdofpreyru has fixed issue at his fork: https://github.com/birdofpreyru/babel-plugin-react-css-modules as well as released package at https://www.npmjs.com/package/@dr.pogodin/babel-plugin-react-css-modules Solved issues for me. Setting context for the webpack and babel's plugin did not do anything for me and it makes sense, because context is set to cwd by default, which was correct in my case. |
my.module.less in chrome devtools
Before webpack 4.1.1
After webpack 4.1.1:
My rule:
I'm guessing here that
[path]
is the item missing in the output.Any thoughts? Is this a bug?
The text was updated successfully, but these errors were encountered: