-
Notifications
You must be signed in to change notification settings - Fork 194
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
Web as a target #132
Comments
It is probably worth to investigate packages like We will be starting a new project internally to test it out, so might be a nice battlefield. |
This seems like it would be pretty easy actually. React-native-web just uses an alias in webpack to resolve I think it would be pretty easy to add web as a platform to the cli, and add it to the default config.
// completely untested.
module.exports = ({ platform }, defaults) => ({
entry: `./index.${platform}.js`,
module: {
...defaults.module,
rules: [
...defaults.module.rules,
{
test: /\.js$/,
use: 'custom-loader',
}
],
},
resolve: {
...defaults.resolve,
alias: platform === 'web' // if the platform is web, alias react-native to react-native-web
? {
...defaults.resolve.alias,
'react-native': 'react-native-web',
}
: defaults.resolve.alias,
plugins: [...defaults.resolve.plugins, new CustomPlugin()],
modules: ['src'],
},
}); |
Not really. There are several things we need to take care of,
|
Well, here is their demo webpack loader config for the react-native-webpack-starter
Which ones are you talking about? I'm trying to find them in the src of haul. I am currently reworking my boilerplate https://github.com/ericwooley/react-nativeish and switching to haul. It would be pretty awesome to remove a lot of the webpack stuff from the boilerplate and offload it onto the cli. Would you be open to a PR for this? |
I'm interested in helping those of you looking to get Haul and RNW play nice together, and it would be good if the webpack asset loader could eventually be published separately (for people integrating RNW into existing apps or not using Haul). Reaching into RN internals is a bit of a problem when it comes to supporting platforms beyond |
Since Haul uses Webpack, it'll finally be possible to use a single bundler for both web and native when you're building an universal application.
Probably not a short-term target. But I hope this will be true in the long term.
The text was updated successfully, but these errors were encountered: