diff --git a/app/react-native/readme.md b/app/react-native/readme.md index cb0bc0a2cef..5f2e0326dc2 100644 --- a/app/react-native/readme.md +++ b/app/react-native/readme.md @@ -82,7 +82,7 @@ If you are using Android and you get the following error after running the app: If you want to use haul instead of the react-native packager, modify the storybook npm script to: ```sh -storybook start -p 7007 --haul webpack.haul.storybook.js +storybook start -p 7007 --haul webpack.haul.storybook.js --platform android | ios | all ``` Where webpack.haul.storybook.js should look something like this: diff --git a/app/react-native/src/bin/storybook-start.js b/app/react-native/src/bin/storybook-start.js index 95c6cea0ed3..42d2fe74e7a 100644 --- a/app/react-native/src/bin/storybook-start.js +++ b/app/react-native/src/bin/storybook-start.js @@ -10,6 +10,7 @@ program .option('-h, --host ', 'host to listen on') .option('-p, --port ', 'port to listen on') .option('--haul ', 'use haul with config file') + .option('--platform ', 'build platform-specific build') .option('-s, --secured', 'whether server is running on https') .option('-c, --config-dir [dir-name]', 'storybook config directory') .option('-e, --environment [environment]', 'DEVELOPMENT/PRODUCTION environment for webpack') @@ -76,7 +77,8 @@ if (!program.skipPackager) { let cliCommand = 'node node_modules/react-native/local-cli/cli.js start'; if (program.haul) { - cliCommand = `node node_modules/.bin/haul start --config ${program.haul} --platform all`; + const platform = program.platform || 'all'; + cliCommand = `node node_modules/.bin/haul start --config ${program.haul} --platform ${platform}`; } // RN packager shelljs.exec(