gruntjs - Grunt specify order of injected files in index.html -
i using angular-fullstack yeoman generator 1 of projects , if run grunt build index.html overwritten injected dependencies grunt-injector finds. problem want specify loading of of modules in order or want ignore specific folder. how can that? javascript files loaded in wrong order , every time run grunt build error.
you can use arrays specify order, instance
// inject application script files index.html scriptsvendor: { options: { transform: function(filepath) { filepath = filepath.replace('/app/', ''); return '<script src="' + filepath + '"></script>'; }, starttag: '<!-- injector:js -->', endtag: '<!-- endinjector -->' }, files: { 'app/index.html': [ [ 'app/lib/js/jquery.js', 'app/lib/js/bootstrap.js', 'app/lib/js/angular.js' ], [ 'app/lib/js/angular-*.js', 'app/lib/js/ui-*.js' ] } }
so load before jquery
bootstrap
, angular
. in next block angular modules starting angular-
, ui-
.
to ignore files or folder
!app/lib/js/*.min.js !app/lib/js/folder_to_ignore/*.js
even if bit late hope helps :-)