basisjs-tools-build
Advanced tools
Comparing version 1.11.4 to 1.12.0
@@ -0,1 +1,8 @@ | ||
## 1.12.0 (November 8, 2017) | ||
- Replaced `uglify-js` to `uglify-es` | ||
- Added posibility to config JavaScript minifier with `--js-pack-config` CLI option or `jsPackConfig` field in config file | ||
- Fixed exception handling when command run in child process and exception is connected with dependencies | ||
- Update dependencies | ||
## 1.11.4 (September 20, 2017) | ||
@@ -2,0 +9,0 @@ |
@@ -118,2 +118,14 @@ var path = require('path'); | ||
.option('--js-pack', 'Compress JavaScript') | ||
.option('--js-pack-config <config>', 'Options for minifier (uglify-es is used for now)', function(config){ | ||
if (typeof config === 'string') | ||
try { | ||
return JSON.parse(config); | ||
} catch(e) { | ||
return null; | ||
} | ||
else if (config && typeof config === 'object' && config.constructor === Object) | ||
return config; | ||
return null; | ||
}, null) | ||
.option('--js-pack-cmd <string>', 'Command to launch JavaScript packer, should accept input in stdio and output result in stdout (`google-closure-compiler --charset UTF-8` by default)') | ||
@@ -120,0 +132,0 @@ |
@@ -0,1 +1,2 @@ | ||
var isChildProcess = require('../common/isChildProcess'); // should go first since handle uncaught exceptions | ||
var fs = require('fs'); | ||
@@ -11,13 +12,3 @@ var path = require('path'); | ||
var utils = require('../common/utils'); | ||
var isChildProcess = typeof process.send == 'function'; // child process has send method | ||
if (isChildProcess) | ||
process.on('uncaughtException', function(error){ | ||
process.send({ | ||
errorType: 'Exception', | ||
error: String(error) | ||
}); | ||
process.exit(2); | ||
}); | ||
// | ||
@@ -24,0 +15,0 @@ // launched by another module |
@@ -154,3 +154,14 @@ var exec = require('child_process').exec; | ||
flow.console.log('Compress ' + file.relOutputFilename); | ||
file.outputContent = require('uglify-js').minify(file.outputContent).code; | ||
var config = flow.options.jsPackConfig || { compress: { ecma: 5 }, output: { ecma: 5 } }; | ||
var result = require('uglify-es').minify(file.outputContent, config); | ||
var error = result.error; | ||
if (error) | ||
return flow.warn({ | ||
fatal: true, | ||
message: file.relOutputFilename + ':' + error.line + ':' + error.col + ' compression error:\n' + error.message | ||
}); | ||
file.outputContent = result.code; | ||
} |
@@ -0,1 +1,2 @@ | ||
var isChildProcess = require('../common/isChildProcess'); // should go first since handle uncaught exceptions | ||
var fs = require('fs'); | ||
@@ -8,14 +9,4 @@ var path = require('path'); | ||
var command = require('./command'); | ||
var isChildProcess = typeof process.send == 'function'; // child process has send method | ||
if (isChildProcess) | ||
process.on('uncaughtException', function(error){ | ||
process.send({ | ||
errorType: 'Exception', | ||
error: String(error) | ||
}); | ||
process.exit(2); | ||
}); | ||
// | ||
@@ -22,0 +13,0 @@ // export |
@@ -0,1 +1,2 @@ | ||
var isChildProcess = require('../common/isChildProcess'); // should go first since handle uncaught exceptions | ||
var fs = require('fs'); | ||
@@ -9,14 +10,4 @@ var path = require('path'); | ||
var chalk = require('chalk'); | ||
var isChildProcess = typeof process.send == 'function'; // child process has send method | ||
if (isChildProcess) | ||
process.on('uncaughtException', function(error){ | ||
process.send({ | ||
errorType: 'Exception', | ||
error: String(error) | ||
}); | ||
process.exit(2); | ||
}); | ||
// | ||
@@ -23,0 +14,0 @@ // launched by another module |
{ | ||
"name": "basisjs-tools-build", | ||
"title": "Basis.js build tools", | ||
"version": "1.11.4", | ||
"version": "1.12.0", | ||
"homepage": "https://github.com/basisjs/basisjs-tools", | ||
@@ -43,11 +43,11 @@ "description": "Build tools for basis.js framework", | ||
"basisjs-tools-config": "~1.1.0", | ||
"chalk": "^1.1.3", | ||
"chalk": "^2.3.0", | ||
"clap": "^1.2.3", | ||
"es6-promise-polyfill": "^1.2.0", | ||
"fixed-width-string": "^1.0.0", | ||
"mime": "~1.4.0", | ||
"mime": "~2.0.3", | ||
"minimatch": "^3.0.2", | ||
"resolve": "^1.1.7", | ||
"seedrandom": "~2.4.2", | ||
"uglify-js": "^3.0.28" | ||
"uglify-es": "~3.1.8" | ||
}, | ||
@@ -54,0 +54,0 @@ "devDependencies": { |
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
301891
90
9124
+ Addeduglify-es@~3.1.8
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcommander@2.11.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedmime@2.0.5(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addeduglify-es@3.1.10(transitive)
- Removeduglify-js@^3.0.28
- Removedmime@1.4.1(transitive)
- Removeduglify-js@3.19.3(transitive)
Updatedchalk@^2.3.0
Updatedmime@~2.0.3