[Vuejs]-Vue.js – How to loop through a folder

1👍

You can use require.context

const configurations = require.context('./modules', true, /config\.js$/i);
configurations.keys().forEach(filename =>
{
  console.log(filename);
  // file contents will be inside configurations[filename]
});

Leave a comment