Skip to content

Instantly share code, notes, and snippets.

@anthonyringoet
Created November 22, 2013 08:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyringoet/7596751 to your computer and use it in GitHub Desktop.
Save anthonyringoet/7596751 to your computer and use it in GitHub Desktop.
Auto compile browserify with Grunt and watch
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
dist: {
files: {
'build/module.js': ['js/**/*.js']
}
}
},
watch: {
scripts: {
files: ['js/**/*.js'],
tasks: ['browserify'],
options: {
spawn: false,
debounceDelay: 250
},
},
},
});
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['browserify']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment