I'm new in server-side React rendering, and I can make simple isomorphic React applications with webpack for client side and Express for server side (through React of course). But now I have some trouble - I decided to use images in my project:
export default class JustImage extends Component {
render() {
return (
<div>
<img src={require("just_image.png")} />
</div>
);
}
}
It code works like a charm for client, but my server side code when I try to render tell me this error:
just_image.png: Unexpected character '�'
As I understand, Node.js doesn't know anything about webpack loaders, so can't load image right. Because I'm new in React and server-side rendering at all I want to know if there are any standard ways to fix this problem - not images only, I use images(PNG/JPEG/JPG/ICO), SVG, SASS/LESS/CSS. Thanks in advance.