Skip to content

Commit

Permalink
Made bundle.js write the uncompressed bundle only when standalone is …
Browse files Browse the repository at this point in the history
…present. Previously, it would instead write it, and remove it later if applicable.
  • Loading branch information
boenrobot committed May 19, 2017
1 parent 38808e1 commit a7804bd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scripts/bundle.js
Expand Up @@ -29,8 +29,6 @@ browserify(bOpts)
}

var outputFile = path.join(distDir, json.name);
var outputBundle = outputFile + '.bundle.js';
fs.writeFileSync(outputBundle, buf);
var uglifyOpts = {
warnings: true,
compress: {},
Expand All @@ -55,7 +53,7 @@ browserify(bOpts)
var result = uglify.minify(buf.toString(), uglifyOpts);
fs.writeFileSync(outputFile + '.min.js', result.code);
if (result.map) fs.writeFileSync(outputFile + '.min.js.map', result.map);
if (!standalone) fs.unlinkSync(outputBundle);
if (standalone) fs.writeFileSync(outputFile + '.bundle.js', buf);
if (result.warnings) {
for (var j=0, jl = result.warnings.length; j<jl; ++j)
console.warn('UglifyJS warning:', result.warnings[j]);
Expand Down

0 comments on commit a7804bd

Please sign in to comment.