Last active
December 1, 2020 10:43
-
-
Save devzom/fbd8c883b83b681dec02cdaecfc3cdd9 to your computer and use it in GitHub Desktop.
webpack: itterate image files inside a assets folder (ex. Vue)
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
/* | |
#You can utilize webpack's require.context() to list files in a given directory at compile time. | |
# https://webpack.js.org/guides/dependency-management/ | |
*/ | |
const illustrations = require.context( | |
'@/assets/illustrations', | |
true, | |
/^.*\.jpg$/ | |
) | |
console.log(illustrations.keys()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment