angularjs - Using grunt to concatenate all vendor javascript files? -


i'm using yeoman (v1.x) grunt (v0.4.2) build angular project. build task concatenates app/script js files, leaves of dependency files unconcatenated, built index.html makes these calls:

<script src="components/angular-unstable/angular.js"></script> <script src="components/jquery/jquery.js"></script> <script src="components/angular-resource/angular-resource.js"></script> <script src="components/bootstrap/js/bootstrap-dropdown.js"></script> <script src="components/moment/moment.js"></script> <script src="components/underscore/underscore.js"></script>  <!-- xxxxxbuild:js scripts/scripts.js --> <script src="scripts/274baf7d.scripts.js"></script> 

i of components project uses, i.e. angular.js, jquery.js, , forth, in scripts.js. easy reconfigure gruntfile so? or not done default practical reason?

yes, easy configure. add vendors scripts in sources pass grunt concat task.

// project configuration. grunt.initconfig({   concat: {     dist: {       src: ['vendors/**/*.js', 'scripts/**/*.js'],       dest: 'built.js'     }   } }); 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -