DEV Community


Discussion on: Architecting Vuex store for large-scale Vue.js applications

maftalion profile image
Matthew Aftalion

I really like the auto-importer. One optimization though:
Since you're appending all your module files with .store.js you can just change your regex to:
const requireModule = require.context('.', false, /\.store.js$/);
and that allows you to get rid of if (filename === './index.js') return;

haxzie profile image
Musthaq Ahamad Author

Yes! Thanks for the suggestion Matthew ✨