Skip to content

Instantly share code, notes, and snippets.

@kamilziajka
Created April 7, 2016 10:09
Show Gist options
  • Save kamilziajka/8ebdf08c557b4642ff29f2067f30efa9 to your computer and use it in GitHub Desktop.
Save kamilziajka/8ebdf08c557b4642ff29f2067f30efa9 to your computer and use it in GitHub Desktop.
cli config + babel
#!/usr/bin/env node
'use strict';
const path = require('path');
const temp = process.cwd();
process.chdir(path.resolve(__dirname, '../'));
require('config');
process.chdir(temp);
require('babel-register')({
presets: ['es2015', 'stage-0'],
only: 'my-cli-tool/@(src|bin)/*.js'
});
require('babel-polyfill');
require('./cli');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment