storybook/scripts/prepublish.js
Darek Rossman 2ac8cf3077 Do not ignore story.js in prepublish
This is causing an issue with addons-info as it ends up ignoring `Story.js` during compilation. Seems there are case-similar files in other addon packages called `story.js` that were supposed to be ignored from output... However, this seems like the quickest fix that doesn't really have an impact on other packages.
2017-04-28 08:58:01 -04:00

27 lines
667 B
JavaScript

const path = require('path');
const shell = require('shelljs');
const chalk = require('chalk');
const babel = path.join(__dirname, '..', 'node_modules', '.bin', 'babel');
require('./ver');
const args = [
'--ignore tests,__tests__,test.js,stories/,story.jsx',
'--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('');
const code = shell.exec(cmd).code;
if (code === 0) {
shell.echo(chalk.gray('\n=> Transpiling completed.'));
} else {
shell.exit(code);
}