Skip to content

Instantly share code, notes, and snippets.

@gergelyke
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gergelyke/9051146 to your computer and use it in GitHub Desktop.
Save gergelyke/9051146 to your computer and use it in GitHub Desktop.
Gruntfile to concat & uglify
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
concat: {
dist: {
src: ['main.js', 'ctrl1.js'], //source files goes here
dest: 'build/lib.js' //concatenated file goes here
}
},
uglify: {
options: {
compress: {
dead_code: true
},
wrap: true,
sourceMap: true
},
dist: {
src: '<%= concat.dist.dest %>',
dest: 'build/lib.min.js',
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('build', ['concat', 'uglify']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment