Skip to content

Instantly share code, notes, and snippets.

@devzom
Last active December 1, 2020 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devzom/fbd8c883b83b681dec02cdaecfc3cdd9 to your computer and use it in GitHub Desktop.
Save devzom/fbd8c883b83b681dec02cdaecfc3cdd9 to your computer and use it in GitHub Desktop.
webpack: itterate image files inside a assets folder (ex. Vue)
/*
#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