Skip to content

Instantly share code, notes, and snippets.

@spencercarnage
Created October 1, 2013 22:30
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 spencercarnage/6786259 to your computer and use it in GitHub Desktop.
Save spencercarnage/6786259 to your computer and use it in GitHub Desktop.
Sample grunt config using browserify
module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
browserify: {
pages: {
files: [
{
expand: true,
cwd: 'javascript/src/pages/',
src: ['**/app.js'],
dest: 'javascript/build/pages/',
ext: '.js'
}
],
options: {
alias: [
'javascript/libs/jquery.validate.min.js:validate'
],
shim: {
jQuery: {
path: 'javascript/libs/jquery-1.7.1.min.js',
exports: 'jQuery'
}
}
}
}
},
watch: {
grunt: {
files: ['Gruntfile.js']
},
pages: {
files: ['javascript/src/pages/**/app.js'],
tasks: ['browserify:pages'],
options: {
livereload: true
}
}
}
  });
 
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment