Skip to content

Instantly share code, notes, and snippets.

@geekgonecrazy
Last active December 24, 2015 14:49
Show Gist options
  • Save geekgonecrazy/6815428 to your computer and use it in GitHub Desktop.
Save geekgonecrazy/6815428 to your computer and use it in GitHub Desktop.
// Gruntfile with the configuration of grunt-express and grunt-open. No livereload yet!
module.exports = function(grunt) {
// Load Grunt tasks declared in the package.json file
require('matchdep').filter('grunt-*').forEach(grunt.loadNpmTasks);
// Configure Grunt
grunt.initConfig({
//pkg: grunt.file.readJSON('package.json'),
//can use <%= pkg.name %> etc to access package.json attributes.
// grunt-watch will monitor the projects files
watch: {
all: {
files: ['public/js/**/*.js', 'public/css/**/*.css', 'views/**/*.ejs'],
options: {
livereload: true
}
}
},
concat: {
options: {
separator: ';'
},
libjs: {
src : ['public/libs/jquery*.js', 'public/libs/**/*.js'],
dest : 'public/js/libs.js'
},
libcss: {
src : ['public/libs/**/*.css'],
dest : 'public/css/libs.css'
}
},
uglify : {
libjs : {
src: ['public/js/libs.js'],
dest: 'public/js/libs.min.js'
}
},
cssmin : {
libcss : {
src: ['public/css/libs.css'],
dest: 'public/css/libs.min.css'
}
}
});
grunt.registerTask('default', ['concat:libjs', 'concat:libcss', 'uglify:libjs', 'cssmin:libcss', 'watch']);
};
{
"name": "application-name",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "3.0.0rc5",
"ejs": "*",
"grunt": "*",
"matchdep": "*",
"grunt-contrib-watch": "*",
"grunt-contrib-concat": "*",
"grunt-contrib-uglify": "*",
"grunt-contrib-cssmin": "*"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment