The following demo demonstrates the loading order of files with dependency. Below is my project directory structure. JS folder contains number of js files (required by project).

– js
—main.js (this is having the configuration)
—app.js (init the loading process)

We are going to load the js files in the following order.






Open in new tab with browser developer tool and track the loading order