This is my first time using Grunt and I\'d like to have it combine all my js modules, each of which is wrapped in an immediately executing function, containing a \'use stric
As of pull request 10, grunt-contrib-concat now has a footer
option. Instead of an intro and an outro file, I would use a banner and a footer.
Gruntfile.js
concat: {
dist: {
src: ['src/my-lib.js'],
dest: 'dist/<%= pkg.name %>.js',
options: {
banner: ";(function( window, undefined ){ \n 'use strict';",
footer: "}( window ));"
}
}
}
In my opinion, this is more maintainable and allows for templating using other properties defined in your Gruntfile.