Say, for example, you are building a project on Backbone or whatever and you need to load scripts in a certain order, e.g. underscore.js
needs to be loaded befo
I'm in a module environnement where all are core-dependents using gulp.
So, the core
module needs to be appended before the others.
What I did:
src
foldergulp-rename
your core
directory to _core
gulp is keeping the order of your gulp.src
, my concat src
looks like this:
concat: ['./client/src/js/*.js', './client/src/js/**/*.js', './client/src/js/**/**/*.js']
It'll obviously take the _
as the first directory from the list (natural sort?).
Note (angularjs):
I then use gulp-angular-extender to dynamically add the modules to the core
module.
Compiled it looks like this:
angular.module('Core', ["ui.router","mm.foundation",(...),"Admin","Products"])
Where Admin and Products are two modules.