Writing modular and dependency based JavaScript


Usually most of the websites are always using some kind of JavaScript to make them more interesting and modern. Occasionally this means animations, carousels, parallax scrolling and so on.

To create this kind of functionality, some developers are loading tens of JavaScript files separately and no further code or dependency organizing is done. It will be hard for other developers who have to maintain the code –  it is unreadable and scripts may easily overlap when creating new features.

This is okay for simple websites, but what happens when we are dealing with a large scale website, which has huge amount of different JavaScript files in various sizes ? Code is not organized anymore and it is hard to maintain. How to solve this problem?

Continue reading