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

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

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -