Comparing version 1.1.0 to 1.2.0
21
index.js
@@ -23,3 +23,5 @@ var log = require('bole')('budo') | ||
argv.dir = argv.dir || process.cwd() | ||
getOutput(argv, function(err, output) { | ||
var outOpts = xtend(argv, { __to: entryMapping() }) | ||
getOutput(outOpts, function(err, output) { | ||
if (err) { | ||
@@ -53,2 +55,19 @@ console.error("Error: Could not create temp bundle.js directory") | ||
}) | ||
function entryMapping() { | ||
var mapTo | ||
var first = argv._[0] | ||
var parts = first.split(':') | ||
if (parts.length > 1 && parts[1].length > 0) { | ||
var from = parts[0] | ||
var to = parts[1] | ||
argv._[0] = from | ||
//clean up original arguments for watchify | ||
var idx = args.indexOf(first) | ||
if (idx>=0) | ||
args[idx] = from | ||
mapTo = to | ||
} | ||
return mapTo | ||
} | ||
} |
@@ -8,11 +8,13 @@ var path = require('path') | ||
if (!outfile) { | ||
var to = 'bundle.js' | ||
//user can specify a mapping for temp dirs | ||
var bundleTo = argv.__to || 'bundle.js' | ||
tmpdir(function(err, filedir) { | ||
var output | ||
if (!err) { | ||
var file = path.join(filedir, to) | ||
var file = path.join(filedir, bundleTo) | ||
output = { | ||
tmp: true, | ||
from: file, | ||
to: to, | ||
to: bundleTo, | ||
dir: filedir | ||
@@ -19,0 +21,0 @@ } |
@@ -27,3 +27,2 @@ var ecstatic = require('ecstatic') | ||
entryHandler = ecstatic({ root: out.dir }) | ||
router.addRoute('/' + out.to, function(req, res, params) { | ||
@@ -30,0 +29,0 @@ log.info({ url: req.url, type: 'static' }) |
{ | ||
"name": "budo", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "a browserify server for rapid prototyping", | ||
@@ -55,3 +55,4 @@ "main": "index.js", | ||
"live": "./bin/cmd.js example/app.js --dir example --live | garnish -v", | ||
"live-plugin": "./bin/cmd.js example/app.js --dir example --live-plugin | garnish -v" | ||
"live-plugin": "./bin/cmd.js example/app.js --dir example --live-plugin | garnish -v", | ||
"remap": "./bin/cmd.js example/app:bundle2.js --dir example --live | garnish -v" | ||
}, | ||
@@ -58,0 +59,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14038
286