-
-
Save japboy/04876d277f1b91aa76d9 to your computer and use it in GitHub Desktop.
A script to convert from ES6 to ES5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node --harmony | |
var fs = require('fs'); | |
var path = require('path'); | |
var browserify = require('browserify'); | |
var f = fs.statSync(process.argv[2]).isFile() ? path.resolve(process.argv[2]) : ''; | |
browserify({ debug: true }) | |
.transform('babelify', { presets: [ 'es2015' ] }) | |
.require(f, { entry: true }) | |
.bundle() | |
.on('error', (err) => console.log(`Error: ${err.message}`)) | |
.pipe(fs.createWriteStream('bundle.js')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment