Skip to content

Instantly share code, notes, and snippets.

@srhise
Created January 30, 2014 01:00
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 srhise/8700646 to your computer and use it in GitHub Desktop.
Save srhise/8700646 to your computer and use it in GitHub Desktop.
Simple Grunt Setup (2 Files)
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
css: {
src: [
'css/*'
],
dest: 'combined.css'
},
js: {
src: [
'js/*'
],
dest: 'combined.js'
}
},
cssmin: {
css: {
src: 'combined.css',
dest: 'combined.min.css'
}
},
uglify: {
js: {
files: {
'combined.js': ['combined.js']
}
}
},
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['concat:css', 'cssmin:css', 'concat:js', 'uglify:js']);
};
{
"name" : "MyTestProject",
"title" : "test",
"version" : "1.0.0",
"devDependencies": {
"grunt": "0.4.1",
"grunt-contrib-concat": "0.1.3",
"grunt-contrib-cssmin" : "0.6.1",
"grunt-contrib-watch" : "0.5.3",
"grunt-contrib-uglify" : "0.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment