Closed morgs32 closed 8 years ago
Doing my best, but it's not good enough. If you cold throw an image into your example, that would be great. I've added
{ test: /\.(jpe?g|png|gif|svg)$/i, loaders: [ 'file?hash=sha512&digest=hex&name=[hash].[ext]', 'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false' ] }
To the webpack config, and still doing this in a component: const HeroImg = require('./dish.jpg');
const HeroImg = require('./dish.jpg');
Throws an error:
Unexpected character '�' (1:0) > 1 | ���� [nodemon] app crashed - waiting for file changes before starting...
Thanks!
Try to npm install --save-dev file-loader url-loader
npm install --save-dev file-loader url-loader
The problem is you can't require on the server. It's apparently a well known problem with react isomorphic that I'm just learning about now.
require
Doing my best, but it's not good enough. If you cold throw an image into your example, that would be great. I've added
To the webpack config, and still doing this in a component:
const HeroImg = require('./dish.jpg');
Throws an error:
Thanks!