react-native-storybook-loader icon indicating copy to clipboard operation
react-native-storybook-loader copied to clipboard

Remove the requirement for generated files

Open elderfo opened this issue 7 years ago • 4 comments

See #10 for more discussion on this

elderfo avatar Mar 20 '17 17:03 elderfo

It would be great to abstract this away from the user. But it is possible to do it dynamically with React Native bundler similar to webpack require.context as mentioned here https://getstorybook.io/docs/react-storybook/basics/writing-stories ...

Related: https://github.com/storybooks/react-native-storybook/issues/103

skovhus avatar Mar 23 '17 14:03 skovhus

@skovhus, do you have an example of how to configure webpack to do what is in the link? I originally tried that route and was unsuccessful, which is why I ended up writing this.

elderfo avatar Mar 24 '17 02:03 elderfo

RN is not using webpack as bundler, so you cannot do this... I see now that my comment above didn't include a question. That was my intention. ; )

"But is it possible..."

skovhus avatar Mar 24 '17 06:03 skovhus

At least this tool should always generate the file (storyLoader.js) even when there are no stories... currently It doesn't do anything when no stories are found, and this makes storybook.js fail because there is no storyLoader.js.. and also fails if there were stories and then I remove them, storyLoader.js does not get updated and fails at loading the stories

hendrul avatar Mar 16 '18 14:03 hendrul