mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 10:31:06 +08:00
Use installBabel for meteor cli
This commit is contained in:
parent
f1cf6d277b
commit
9c4cff4ec4
@ -2,7 +2,7 @@ import path from 'path';
|
||||
import fs from 'fs';
|
||||
import JSON5 from 'json5';
|
||||
import mergeDirs from 'merge-dirs';
|
||||
import { getVersions, getPackageJson, writePackageJson } from '../../lib/helpers';
|
||||
import { getVersions, getPackageJson, writePackageJson, installBabel } from '../../lib/helpers';
|
||||
|
||||
export default async npmOptions => {
|
||||
const [
|
||||
@ -12,7 +12,6 @@ export default async npmOptions => {
|
||||
addonsVersion,
|
||||
reactVersion,
|
||||
reactDomVersion,
|
||||
babelCoreVersion,
|
||||
presetEnvVersion,
|
||||
presetReactVersion,
|
||||
] = await getVersions(
|
||||
@ -23,7 +22,6 @@ export default async npmOptions => {
|
||||
'@storybook/addons',
|
||||
'react',
|
||||
'react-dom',
|
||||
'@babel/core',
|
||||
'@babel/preset-env',
|
||||
'@babel/preset-react'
|
||||
);
|
||||
@ -53,11 +51,13 @@ export default async npmOptions => {
|
||||
fs.writeFileSync('.babelrc', JSON.stringify(babelrc, null, 2), 'utf8');
|
||||
|
||||
// write the new package.json.
|
||||
packageJson.devDependencies['@babel/core'] = babelCoreVersion;
|
||||
packageJson.devDependencies['@storybook/react'] = storybookVersion;
|
||||
packageJson.devDependencies['@storybook/addon-actions'] = actionsVersion;
|
||||
packageJson.devDependencies['@storybook/addon-links'] = linksVersion;
|
||||
packageJson.devDependencies['@storybook/addons'] = addonsVersion;
|
||||
|
||||
await installBabel(npmOptions, packageJson);
|
||||
|
||||
packageJson.scripts.storybook = 'start-storybook -p 6006';
|
||||
packageJson.scripts['build-storybook'] = 'build-storybook';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user