Created
September 9, 2014 16:02
-
-
Save BrianGenisio/7292a2e0eeed25edf0ac to your computer and use it in GitHub Desktop.
Automatically wrapping files in IIFEs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grunt.initConfig({ | |
concat: { | |
dist: { | |
src: ['src/*.js'], | |
dest: 'dist/app.js', | |
options: { | |
process: wrapInIIFE | |
} | |
}, | |
}, | |
}); | |
function wrapInIIFE(src, filepath) { | |
var header = '(function() { \n'; | |
var footer = '\n})();\n'; | |
return header + src + footer; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment