mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-19 05:02:40 +08:00
Merge pull request #2129 from storybooks/haul-platform-option
#2128 Add platform option for haul bundler
This commit is contained in:
commit
ef7869d9b1
@ -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:
|
||||
|
4
app/react-native/src/bin/storybook-start.js
vendored
4
app/react-native/src/bin/storybook-start.js
vendored
@ -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')
|
||||
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user