storybook/scripts/prepublish.js
Norbert de Langen 7ccb773e72 FIX an issue where a test in a package was using async-await
but was not transpiring them correctly.

MOVE jest cache directory to subdirectory `.cache`
2017-04-27 22:33:36 +02:00

23 lines
590 B
JavaScript

const path = require('path');
const shell = require('shelljs');
const chalk = require('chalk');
const babel = path.join('node_modules', '.bin', 'babel');
require('./ver');
const args = [
'--ignore tests,__tests__,test.js,stories/,story.jsx,story.js',
'--plugins "transform-runtime"',
'./src --out-dir ./dist',
'--copy-files',
].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.'));