Skip to content

Commit

Permalink
Faster rebuilds with watchify.
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Mar 13, 2015
1 parent 8fccf98 commit d5a91f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
23 changes: 14 additions & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ module.exports = function(grunt) {
],
tasks: ['flow:app:status']
},
flowProd: {
files: ['<%= watch.flow.files %>'],
tasks: ['flow:app:status', 'prod']
},
prod: {
files: ['<%= watch.flow.files %>'],
tasks: ['browserify:dist']
}
},
browserify: {
dist: {
Expand All @@ -40,6 +32,20 @@ module.exports = function(grunt) {
'build/tests.js': ['src/**/*.js', 'test/**/*-test.js', '!src/main.js']
}
},
watchDist: {
files: '<%= browserify.dist.files %>',
options: {
watch: true,
keepAlive: true,
}
},
watchTest: {
files: '<%= browserify.test.files %>',
options: {
watch: true,
keepAlive: true,
}
},
options: {
transform: [
[
Expand Down Expand Up @@ -103,7 +109,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.registerTask('watchFlow', ['flow:app:start', 'watch:flow']);
grunt.registerTask('watchFlowProd', ['flow:app:start', 'watch:flowProd']);
grunt.registerTask('prod', ['browserify:dist', 'uglify:dist']);
grunt.registerTask('browsertests', ['browserify:test']);
grunt.registerTask('test', ['browsertests', 'mocha_phantomjs:run']);
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ To iterate on code while running the type checker:

To continuously regenerate the combined JS, run:

grunt watch:prod
grunt browserify:watchDist

To continuously regenerate the testing JS, run:

grunt browserify:watchTest

[hs]: https://github.com/nodeapps/http-server

0 comments on commit d5a91f3

Please sign in to comment.