Closed sAs59 closed 6 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?
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?