-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade React Native to webpack 2 config #1097
Upgrade React Native to webpack 2 config #1097
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
newConfig.module.loaders = [ | ||
...newConfig.module.loaders, | ||
{ | ||
test: /\.css?$/, | ||
include: includePaths, | ||
loaders: [ | ||
use: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! thanks for upgrading this to webpack 2 format!
@@ -3,16 +3,26 @@ import { includePaths } from '../utils'; | |||
|
|||
// Add a default custom config which is similar to what React Create App does. | |||
module.exports = storybookBaseConfig => { | |||
const newConfig = storybookBaseConfig; | |||
const newConfig = { ...storybookBaseConfig }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, can you try just exporting the app/react
version of this file directly? It looks like the configs could probably be shared directly.
this is outside the scope of your PR but I see a lot of shared server files for react-native
and react
as well. we could combine them as much as possible to prevent fixing problems in one while forgetting about the other @ndelangen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we at some point add a third UI library, this will be refactored.
7cca6e0
to
43a665c
Compare
I've updated the code to fix the lint issue that bitHound found (missing comma), but CodeFactor is going to fail due to duplicate code as @danielduan mention in his comment (#1097 (comment)). |
The code validation tools are here to help us, not to block us! |
@danielduan if you think is good to go, just merge! |
That was amazingly speedy! Thanks @ndelangen and @danielduan! |
Issue: #1061 React Native is using the old webpack config format
What I did
I have upgraded the default webpack config, following the changes made in #1062 by @danielduan (see the diff here.
This is the first time I have used webpack directly, so my changes could be very wrong. Feel free to close this and do it a better way if it's more useful. This is, however, allowing Storybook to work correctly with my React Native project.
How to test
react-native init StorybookTest
).getstorybook
.yarn run storybook
.react-native run-ios
) and open http://localhost:7007/ to see the preview working.