Automated Module Registration

Learn how to automate the process of registering each module using Webpack's required method.

We'll cover the following

Importing and registering every single module can be tedious and can result in many import and module registrations in the store file. If our application was scaffolded with Vue-CLI and used Webpack internally, this process can be automated using Webpack’s require method.

The index.js file

Let’s create an index.js file in the store/modules directory with the code shown below.

Get hands-on with 1200+ tech skills courses.