Repository navigation
Conversation
|
This little fix works great for us as well. Here's more context on how we're using it: http://randycoulman.com/blog/2016/03/22/testing-with-mocha-and-webpack/ (reference to this issue at the very end, under |
|
see last section in this chapter: https://github.com/webpack/css-loader#local-scope use |
|
@sokra does that work if I don't use ExtractTextPlugin and rely on shipping my CSS inside JS? I'm asking because with the PR it worked perfectly, I guess the |
|
|
|
I was asking for development. Thank you for clarifying! |
Then it's fine of course... ;) |
We had been using a specific commit of style-loader that matched an outstanding PR that made it work in the node environment (webpack/style-loader#115). That PR was rejected with a suggestion to use `css-loader/locals` instead of the style-loader, so that’s what I’ve done here, which allows us to go back to the stock version of style-loader. I reverted the change that pulled the SCSS handling up to the base webpack config as there is now much less duplication. I ran into a bunch of strange behavior along the way, but what’s here seems to work well: * The decorated style names have an extra `_-_-` prefix on them that doesn’t show up in the browser environment. * Using the trailing `!sass` on the loader definition resulted in a random suffix of either `—sass` or `-sass` or none at all being added to the style names, and it’s inconsistent enough to potentially make specs fail. Moving the other loaders to a separate element of the array resolves this. * I found that I don’t actually seem to need the sass loader at all, and that makes no sense to me at all. I’ve left it in because it seems like it really needs to be there, but I am very confused by what I saw.
|
So... this never got merged? And style-loader is still broken for server-side rendering? |
|
@peterh32 style-loader works good with SSR. Please don't write about your problem in old closed issue, |
|
|
1 similar comment
|
|
|
It look like in 1.0.0 it's come back 😢 |
|
@alsun no |
I'm using local scopes and I wasn't able to render on the server side because of style loader. This little fix solved all my problems 👍