Skip to content

Instantly share code, notes, and snippets.

@geekgonecrazy
Last active December 24, 2015 14:49

Revisions

  1. @aaronogle aaronogle revised this gist Oct 3, 2013. 2 changed files with 19 additions and 3 deletions.
    16 changes: 15 additions & 1 deletion gruntfile.js
    Original file line number Diff line number Diff line change
    @@ -31,8 +31,22 @@ module.exports = function(grunt) {
    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', 'watch']);
    grunt.registerTask('default', ['concat:libjs', 'concat:libcss', 'uglify:libjs', 'cssmin:libcss', 'watch']);
    };
    6 changes: 4 additions & 2 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,11 @@
    "dependencies": {
    "express": "3.0.0rc5",
    "ejs": "*",
    "grunt": "*",
    "grunt": "*",
    "matchdep": "*",
    "grunt-contrib-watch": "*",
    "grunt-contrib-concat": "*"
    "grunt-contrib-concat": "*",
    "grunt-contrib-uglify": "*",
    "grunt-contrib-cssmin": "*"
    }
    }
  2. @aaronogle aaronogle created this gist Oct 3, 2013.
    38 changes: 38 additions & 0 deletions gruntfile.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    // 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'
    }
    }
    });

    grunt.registerTask('default', ['concat:libjs', 'concat:libcss', 'watch']);
    };
    16 changes: 16 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    {
    "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": "*"
    }
    }