brendangibson
brendangibson

Reputation: 2542

How do I import images using universal-webpack?

I am trying to render a react application on the server using universal-webpack.

I have many pieces of the puzzle working, however I am unable to import images within my code.

If I have the code

import catPic from 'cat.png'

in one of my react components, I get the following error:

SyntaxError: cat.png: Unexpected character '�' (1:0)

Is there something that I should look for in my configuration or server.js?

Upvotes: 0

Views: 111

Answers (1)

catamphetamine
catamphetamine

Reputation: 4741

You haven't added a Webpack file-loader for PNG images

Upvotes: 0

Related Questions