sambernard / react-preload

Component to preload images before showing content
MIT License
148 stars 48 forks source link

Preload images with hashes #24

Closed sAs59 closed 6 years ago

sAs59 commented 7 years ago

I want to preload multiple images in folder using require.context as follows:

let images = require.context("../assets/images", false, /\.(png|jpe?g|svg)$/).keys(); images = images.map(image => image.replace("./", "../assets/images/"));

It loads all images as expected, but without hashes. Create-react-app insert hashes by default when importing images.

How can I add hashes into my array of images?