If you have used RequireJS, you most definitely have come across this: Repeatation of requirejs configuration.
You end up repeating the shims and paths in multiple locations. We can minimise this by using
requirejs.config() will help you define or override your dependencies configuration.
Here is an examlpe on how I use
requirejs.config method for minimising repeatation.
First let us define the reusable configuration file. Let’s name it
Here we have defined the paths for all the common dependencies.
Now let us use it in two different places.
The file-layout here is like the following.
Hope it helps!
Author: Deepu Mohan Puthrote
This work by Deepu Mohan Puthrote is licensed under a Creative Commons Attribution 4.0 International License