-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add react-native-web to the template #599
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
Conversation
@@ -71,6 +86,8 @@ https://github.com/npm/npm/issues/16991 | |||
eject: 'react-native-scripts eject', | |||
android: 'react-native-scripts android', | |||
ios: 'react-native-scripts ios', | |||
web: './node_modules/.bin/webpack-dev-server -d --config ./webpack.config.js --inline --hot --colors --content-base public/', |
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.
no need to scope with ./node_modules
here, we can just do webpack-dev-server
the direction of this looks great. one request which may complicate things a bit but I think is important to keep this as an opt-in feature until it stabilizes — could we possibly put it under a flag? so |
ideally we would hide the webpack config but I think web support isn't at a level of maturity where we can get away with that yet. I'm going to land this and publish it in a pre-release so more people can play with it. thanks! |
FWIW I think Metro is supposed to support bundling for web now (and code-splitting at some point). So you might be able to rely on the same bundler for all platforms pretty soon. |
After the creating the native app with this argument, and ejecting it, I do have some problems when running
Did somebody else have this issue as well? |
yarn web
will now start webpack-dev-server, which will show the same screen as the ios/android apps.yarn build
will build for production (into public/assets).Note this install
expo-web
as a dependency, andbabel-plugin-expo-web
to replace all instances ofimport { .... } from 'expo'
withimport { .... } from 'expo-web'
.