Skip to content


Subversion checkout URL

You can clone with
Download ZIP


cli --watch is not working #210

jasonkuhrt opened this Issue · 8 comments

6 participants


I am on osx Mountain Lion, node 8.6, macvim

Commands like:

browserify -w -e -o public/app.js
browserify -o public/app.js -w

Compile successfully, but any subsequent file changes (entry or required files) does not cause a recompile.

Who else is having this issue?


I am still having this problem with 1.15.5


I have the same problem on Windows with node 0.8.9 and browserify 1.16.1


watch is gone in v2 but when it comes back I'd like to have it be a separate module entirely.

@substack substack closed this

Looking forword to --watch's recurrence.


Meanwhile you could use isaac's supervisor. I use it for compiling less files. I haven't tested the command but you could try something like this:

supervisor -n exit -w -x browserify -- -o public/app.js


@jhnns Since I write CoffeeScript, Stylus and all of them need compiling,
by now I use a Cakefile to compile them(doodle is my personal comamnd)..
Seems Browserify need to watch more than one file which appears in that command.
Does supervisor watch the files required by this one(I'm not familiar about that)?

My Cakefile:

{spawn, exec} = require "child_process"
fs = require "fs"

echo = (child) ->
  child.stderr.pipe process.stderr
  child.stdout.pipe process.stdout

split = (str) -> str.split " "

queue = [
  "jade -O ./ -wP layout/index.jade"
  "coffee -o page/ -wbc action/"
  "stylus -o page/ -w layout/"
  "doodle page/page.css index.html build.js"

build = ->
  exec "browserify -d page/main.js", (err, stdout, stderr) ->
    console.log "write.. #{stdout[..40]}"
    fs.writeFile "build.js", stdout, "utf8"

stamp = 0
cache = 0

do watch_loop = ->
  unless cache is stamp
    cache = stamp
  setTimeout watch_loop, 300

task "dev", "watch and convert files", -> (array) ->
    echo (spawn array[0], array[1..])

  list = fs.readdirSync "page/"
  for name in list
    if name.match /\S+\.js$/ "page/#{name}", interval: 200, ->
        stamp += 1

Quite hope there's an abstraction between CLI and Node which can do that.


I've used this dead simple shell script

./ browserify foo.js > bundle.js

@epeli inotifywait is wonderful!

@jiyinyiyong jiyinyiyong referenced this issue in coffee-js/languages

Browserify + coffeeify 的前端调试方案 #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.