Last active
August 29, 2015 14:05
-
-
Save dmahipus/af702a792f4b2bfbf87c to your computer and use it in GitHub Desktop.
Basic gruntfile with concat and uglify tasks
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
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), //<---imports the JSON metadata stored in package.json | |
concat:{ | |
dist: { | |
src: [ | |
'js/libs/*.js', // Selects all JS in the libs folder | |
'js/main.js' | |
], | |
dest: 'js/build/production.js', //Output file after concatenating js files | |
} | |
}, | |
uglify: { | |
build: { | |
src: 'js/build/production.js', | |
dest: 'js/build/production.min.js' | |
} | |
} | |
}); | |
// Load the plugin that provides the "concat" task. | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
// Load the plugin that provides the "uglify" task. | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
// Default task(s). | |
grunt.registerTask('default', ['concat', 'uglify']); //<--- adds "concat" and "uglify" to the default task | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment