M
M
Maxim Nikulin2016-04-27 10:42:04
React
Maxim Nikulin, 2016-04-27 10:42:04

How to unload images from the src attribute of an img (jsx) tag in a production build of Webpack?

Hello. There is a react component, I would like from the code:
<img src='img/cat.svg' alt="" width = '200'/>
pull the image from the corresponding path in production mode, JSX format

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Antropov, 2016-04-27
@Laiff

https://github.com/webpack/file-loader

T
Timofey Dergachev, 2016-05-04
@exeto

file-loader +
<img src={require('./img/cat.svg')} alt="cat" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question