You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I move one of my project to webpack 2 recently. I currently only test on webpack-dev-server mode and seems every things work fine except css module.
Here is part of my webpack configuration which relate to css module:
When I import the .scss file into .js file as beneath, the className of div shows nothing, and the className of h4 only show that class='text-white'. I tried to console.log out the imported variable and it shows an empty object.
I did another testing which make an error code in '_l-header.scss' that can generate some error message in Terminal to prove I use the right configuration of css-module. And here is the error message:
ERROR in ./~/css-loader?{"sourceMap":true,"modules":true,"importLoaders":3,"localIdentName":"[hash:base64]-[name]-[local]"}!./~/postcss-loader?{}!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"sourceMap":true,"includePaths":[]}!./app/style/layout/_l-header.scss
Module build failed:
@extend .blue;
^
".header" failed to @extend ".blue".
According to the message above, I think the loader configuration is correct. Does anyone engage the same issue, or have some solution for this?
I'll really appreciate that!!
The text was updated successfully, but these errors were encountered:
😛 That's the reason I guess, if I remember right css-loader < v0.15.0 didn't use PostCSS and therefore has no { modules: true } (CSSModules), could you try with latest css-loader and see if your config works? You're right css-loader has some perf issues, but these are more related to the bloated code base and we're working on that 😉
I move one of my project to webpack 2 recently. I currently only test on webpack-dev-server mode and seems every things work fine except css module.
Here is part of my webpack configuration which relate to css module:
version:
css-loader: 0.14.5 (for the better performance)
sass-loader: 6.0.3
webpack: 2.3.3
webpack-dev-server: 2.4.2
When I import the .scss file into .js file as beneath, the className of div shows nothing, and the className of h4 only show that class='text-white'. I tried to console.log out the imported variable and it shows an empty object.
I did another testing which make an error code in '_l-header.scss' that can generate some error message in Terminal to prove I use the right configuration of css-module. And here is the error message:
According to the message above, I think the loader configuration is correct. Does anyone engage the same issue, or have some solution for this?
I'll really appreciate that!!
The text was updated successfully, but these errors were encountered: