javascript - Include and reference an image in react with webpack -


what ist best way include , reference images react-usage in singlepage javascript app build , bundled webpack?

so far have

return (<img src={require('./pic.png'}</div>) 

is there better way?

if you're using webpack's url-loader can tell automatically embed data uri if file size under specified limit.

require("url?limit=10000!./pic.png"); // => dataurl if "pic.png" smaller 10kb 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -