2017-04-16 18:11:44 +07:00
|
|
|
const path = require('path');
|
|
|
|
const shell = require('shelljs');
|
|
|
|
const chalk = require('chalk');
|
2017-04-18 20:37:04 +07:00
|
|
|
const babel = path.join('node_modules', '.bin', 'babel');
|
2017-04-16 18:11:44 +07:00
|
|
|
|
|
|
|
require('./ver');
|
|
|
|
|
|
|
|
|
|
|
|
const args = [
|
2017-04-24 19:04:42 +07:00
|
|
|
'--ignore tests,__tests__,test.js,stories/,story.jsx,story.js',
|
2017-04-16 18:11:44 +07:00
|
|
|
'--plugins "transform-runtime"',
|
|
|
|
'./src --out-dir ./dist',
|
2017-04-18 20:37:04 +07:00
|
|
|
'--copy-files',
|
2017-04-16 18:11:44 +07:00
|
|
|
].join(' ');
|
|
|
|
|
|
|
|
const cmd = `${babel} ${args}`;
|
|
|
|
shell.rm('-rf', 'dist');
|
|
|
|
|
|
|
|
shell.echo(chalk.gray('\n=> Transpiling \'src\' into ES5 ...\n'));
|
|
|
|
shell.echo(chalk.gray(cmd));
|
|
|
|
shell.echo('');
|
|
|
|
shell.exec(cmd);
|
|
|
|
shell.echo(chalk.gray('\n=> Transpiling completed.'));
|