-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added isomorphic CSS modules #48
Conversation
This is brilliant! Thanks! 👍 |
You clearly have a better understanding of how webpack works than I do. Perhaps you could make some headway on #39? |
I'll give it a look sometime this week. |
Is it just me or did this commit break style sourcemaps? :-/ |
Yes, I think it did. @ashtonwar !! 😄 |
Yup.. sorry I'm too busy to look into this immediately. My guesses for possible causes:
Based on this query my money is on this bieng an issue with css-loader. |
Hi @erikras I think this library has found a way to resolve the problem on #39 https://github.com/iam4x/isomorphic-flux-boilerplate/blob/master/app/utils/image-resolver.js import imageResolver from 'utils/image-resolver'
let image;
// On browser just require() the image as usual
if (process.env.BROWSER) {
image = require('images/logo.png');
}
else {
image = imageResolver('images/logo.png');
}
...
render () {
return (
<img src={image} />
);
}
... |
I copied it. |
Thanks @erikras |
@erikras Doing |
@ashtonwar Nice. |
Works by searching webpacks internal module memory and extracting the relevant JSON from source. Additional info is saved to webpack-stats.json where it can be read from both the server and client.