Skip to content

Commit

Permalink
updating help.txt, ensuring --delay and --poll are passed to watchify…
Browse files Browse the repository at this point in the history
… from API, setting content-length and statusCode
  • Loading branch information
mattdesl committed Apr 13, 2015
1 parent a11e42c commit 50bd727
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions bin/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ Options:
--port the port to run, default 9966
--host the host, default "localhost"
--dir the directory to serve, and the base for --outfile
--serve override the bundle path being served
--live enable LiveReload integration
--live-plugin enable LiveReload but do not inject script tag
--live-port the LiveReload port, default 35729
--verbose, -v verbose timing information for re-bundles
--poll=N use polling for file watch, with optional interval N
--no-stream do not print messages to stdout
--no-debug do not use inline source maps

Other Options:
https://github.com/substack/node-browserify
Expand Down
8 changes: 5 additions & 3 deletions lib/create-watchify.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ module.exports = function (entries, userArgs, opt, cb) {
}

function fromAPI(browserifyDir, watchifyDir, entries, userArgs) {
userArgs = getDefaultArgs(userArgs)

var watchify = require(watchifyDir)
var browserify = require(browserifyDir)

var b = browserify(getDefaultArgs(userArgs))
var instance = watchify(b)
var b = browserify(userArgs)
var instance = watchify(b, userArgs)
entries.forEach(function(entry) {
instance.add(path.resolve(entry))
})
Expand Down Expand Up @@ -101,7 +103,7 @@ function removeCollisions(opt) {
'dir', 'o', 'outfile', 'port',
'host', 'live', 'serve', 'live-port',
'live-plugin', 'defaultIndex', 'livePort',
'livePlugin'
'livePlugin', 'stream'
]
collisions.forEach(function(col) {
delete opt[col]
Expand Down
3 changes: 3 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ function createHandler(opts) {

function submit(req, res) {
res.setHeader('content-type', 'text/javascript')
res.setHeader('content-length', emitter.contents.length);
res.statusCode = req.statusCode || 200

res.end(emitter.contents)
}

Expand Down

0 comments on commit 50bd727

Please sign in to comment.