mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 22:21:27 +08:00
Fix Create React (Native) App detection
This commit is contained in:
parent
26d3a4228e
commit
07471781c7
@ -9,6 +9,7 @@ module.exports = latestVersion('@storybook/react').then(version => {
|
||||
|
||||
const packageJson = helpers.getPackageJson();
|
||||
|
||||
packageJson.devDependencies = packageJson.devDependencies || {};
|
||||
packageJson.devDependencies['@storybook/react'] = `^${version}`;
|
||||
packageJson.scripts.storybook = 'start-storybook -p 9009';
|
||||
packageJson.scripts['build-storybook'] = 'build-storybook';
|
||||
|
@ -44,7 +44,10 @@ module.exports = function detect(options) {
|
||||
return types.VUE;
|
||||
}
|
||||
|
||||
if (packageJson.devDependencies && packageJson.devDependencies['react-scripts']) {
|
||||
if (
|
||||
(packageJson.dependencies && packageJson.dependencies['react-scripts']) ||
|
||||
(packageJson.devDependencies && packageJson.devDependencies['react-scripts'])
|
||||
) {
|
||||
return types.REACT_SCRIPTS;
|
||||
}
|
||||
|
||||
@ -56,7 +59,10 @@ module.exports = function detect(options) {
|
||||
return types.REACT_PROJECT;
|
||||
}
|
||||
|
||||
if (packageJson.devDependencies && packageJson.devDependencies['react-native-scripts']) {
|
||||
if (
|
||||
(packageJson.dependencies && packageJson.dependencies['react-native-scripts']) ||
|
||||
(packageJson.devDependencies && packageJson.devDependencies['react-native-scripts'])
|
||||
) {
|
||||
return types.REACT_NATIVE_SCRIPTS;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user