build: support node 4 for building js file (by bypassing syntax checking if node < 6)

This commit is contained in:
bordun 2016-11-28 13:35:08 +01:00
parent e29ce249f8
commit df9db253af
3 changed files with 6 additions and 7 deletions

12
scripts/build-js.js Normal file
View file

@ -0,0 +1,12 @@
var browserify = require('browserify'),
path = require('path')
var b = browserify(path.resolve(__dirname + '/../src/browser/js/browser.js'));
// bypass syntax-error check if node version is < 6
if (parseInt(process.version.split('.')[0].replace('v',''))<6) {
b.pipeline.get('syntax').splice(0, 1);
}
b.bundle().pipe(process.stdout);