Hello everyone, I'm currently working on a project structure that looks like this:
intranet
├── modules
│ ├── storage
│ │ ├── views
│ │ └── route
│ │ └── index.js
│ │
│ ├── sales
│ │ ├── views
│ │ └── route
│ │ └── index.js
│ │
│ └── purchases
│ ├── views
│ ├── route
│ └── index.js
│
├── route
│ └── index.js
├── store
│ └── index.js
├── ...
The modules folder will contain all the modules connected to the project, with subfolders for views, routes, etc. Each subfolder will have an index.js file within it.
Now in the intranet > route > index file, I want to do the import as shown below.
import(".../modules/*/route/index").then(module => {
console.log(module);
});
I am trying to achieve a self-import of these modules found within the modules directory. However, I am encountering an error due to the use of the * character in my import statement.
Your assistance on resolving this issue would be greatly appreciated. Thank you.