Comparing version 3.0.4 to 3.0.5
@@ -63,22 +63,35 @@ var plugin | ||
bundleStream.pipe(minifier.consumer(function (err, src, map) { | ||
// If there was a callback given, we are done | ||
if(typeof bundleCb == 'function') { | ||
return bundleCb(err, src, map); | ||
} | ||
var finish; | ||
// Otherwise, throw if anything bad happened | ||
if(err) { throw err; } | ||
// A callback we'll need later | ||
finish = function () { | ||
// Otherwise, throw if anything bad happened | ||
if(err) { throw err; } | ||
// Push the minified src to our proxied stream | ||
minifiedStream._read = function () { | ||
minifiedStream.push(src); | ||
minifiedStream.push(null); | ||
} | ||
minifiedStream.resume(); | ||
minifiedStream.emit('readable'); | ||
if(typeof bundleCb == 'function') { | ||
return bundleCb(err, src, map); | ||
} | ||
}; | ||
// Write the sourcemap to the specified output location | ||
var writeStream = fs.createWriteStream(minifyifyOpts.output); | ||
writeStream.write(map); | ||
writeStream.end(); | ||
if(minifyifyOpts.output) { | ||
var writeStream = fs.createWriteStream(minifyifyOpts.output); | ||
// Push the minified src to our proxied stream | ||
minifiedStream._read = function () { | ||
minifiedStream.push(src); | ||
minifiedStream.push(null); | ||
// Delay completion until the map is written | ||
writeStream.on('close', finish); | ||
writeStream.write(map); | ||
writeStream.end(); | ||
} | ||
minifiedStream.resume(); | ||
minifiedStream.emit('readable'); | ||
else { | ||
finish(); | ||
} | ||
})); | ||
@@ -85,0 +98,0 @@ |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"repository": { | ||
@@ -24,0 +24,0 @@ "type": "git", |
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
18912
396