Comparing version 0.2.34 to 0.3.0
31
index.js
@@ -5,3 +5,3 @@ | ||
/* | ||
* @version 0.2.34 | ||
* @version 0.3.0 | ||
* @date 2016-02-04 | ||
@@ -69,2 +69,6 @@ * @license MIT License | ||
if (args.sourceMap === true) { | ||
args.sourceMap = args.output.replace(/\?|$/, ".map$&") | ||
} | ||
function outputDone() { | ||
@@ -91,8 +95,17 @@ console.log("# compile DONE " + args.output) | ||
function compileLocal() { | ||
console.log("# compileLocal START " + args.output) | ||
var closure = spawn("closure", | ||
args.sourceMap ? | ||
var closure | ||
, directFiles = !banner && !args.toggle | ||
, cliArgs = args.sourceMap ? | ||
["--create_source_map", args.sourceMap, "--source_map_format", "V3"] : | ||
[] | ||
) | ||
console.log("# compileLocal" +(directFiles?"[D]":"")+ " START " + args.output) | ||
if (directFiles) { | ||
args.input.map(function(name) { | ||
cliArgs.push("--js", name.split("?")[0]) | ||
}) | ||
} | ||
closure = spawn("closure", cliArgs) | ||
closure.on("close", outputDone) | ||
@@ -102,3 +115,5 @@ | ||
closure.stderr.pipe(process.stderr) | ||
closure.stdin.end(fileString) | ||
if (!directFiles) { | ||
closure.stdin.end(fileString) | ||
} | ||
} | ||
@@ -175,2 +190,3 @@ | ||
, scripts = [] | ||
, asIsRe = /\sas-is\s/i | ||
, deferScripts = [] | ||
@@ -190,2 +206,3 @@ , inlineRe = /\sinline\s/i | ||
.replace(/<(script)[^>]+src="([^>]*?)"[^>]*><\/\1>/g, function(_, tag, file) { | ||
if (asIsRe.test(_)) return _.replace(asIsRe, " ") | ||
if (exclude.indexOf(file) == -1 && !excludeRe.test(_)) { | ||
@@ -212,3 +229,3 @@ var dataIf = /\sdata-if="([^"]+)"/.exec(_) | ||
rawFiles.push(file) | ||
var arr = /\bdefer\b/i.test(_) ? deferScripts : scripts | ||
var arr = /\b(async|defer)\b/i.test(_) ? deferScripts : scripts | ||
file = '"' + normalizePath(file, root) + '"' | ||
@@ -215,0 +232,0 @@ if (dataIf) file = "(" + dataIf[1] + ")&&" + file |
{ | ||
"name": "buildman", | ||
"version": "0.2.34", | ||
"version": "0.3.0", | ||
"stability": 1, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@version 0.2.34 | ||
@version 0.3.0 | ||
@date 2016-02-04 | ||
@@ -4,0 +4,0 @@ @stability 1 - Experimental |
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
25533
656