Skip to content

Commit

Permalink
Merge pull request #2129 from storybooks/haul-platform-option
Browse files Browse the repository at this point in the history
#2128 Add platform option for haul bundler
  • Loading branch information
z4o4z authored Oct 30, 2017
2 parents 5391854 + 820bf7b commit ef7869d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/react-native/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion app/react-native/src/bin/storybook-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ program
.option('-h, --host <host>', 'host to listen on')
.option('-p, --port <port>', 'port to listen on')
.option('--haul <configFile>', 'use haul with config file')
.option('--platform <ios|android|all>', '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')
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit ef7869d

Please sign in to comment.