-
Notifications
You must be signed in to change notification settings - Fork 44
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
Server side: generateScopedName is not used while using Babel #53
Comments
I'm running into this as well! Let me know if I can help out. |
@dbow well I know, how to hotfix it in code, for your react components use traditional |
Thanks for the report, can you provide your |
@sullenor sure, nothing special there {
"stage": 2
}
|
Mine is
|
I think another workaround is moving this configuration to a separate file that uses index.js:
server.js
and then |
{
"stage": 2
} That looks like babel 5 config, is it? |
@dbow It does. Actually, the new imports are static and always called first (its a feature). And babel usually put them to the beginning of the file. So, if you have CSS import with require hook at the same file, all your imports will occur first and after that you'll configure the require hook. Thats why you get different tokens. As possible solution you can move configuration to the separate file or I also thought about making a separate config, similar to |
@sullenor makes sense! I too was pondering a config file as a solution. |
Finally, I published a beta version with presets implementation, hope that helps: 3.0.0-beta. If you are interested, you can try to use I will publish stable version a bit later, still need to update documentation and demo example. |
Perfect! Thankyou so much, may also be worth mentioning for someone else, don't forget to include any other options such as camelCase, otherwise it may not appear to work. For me it was:
|
If you use babel imports you have something like this:
And you
app.js
imports some css.When you use
babel-node
all the imports go up in the code thereforecssModulesRequireHook()
is called after requiring ofapp.js
resulting into omittinggenerateScopedName
.Solution: return hook as function to be called with options, just like
node-jsx
.The text was updated successfully, but these errors were encountered: