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 -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -