Created
June 28, 2019 14:21
-
-
Save daniepetrov/7f45f6b41ff508cd896a48f8339e8bcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function importAll(r) { | |
const images = {} | |
r.keys().map(item => { | |
images[item.replace('./', '')] = r(item) | |
return null | |
}) | |
return images | |
} | |
const images = importAll(require.context('./images', false, /\.(png|jpe?g|svg)$/)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment