The most painless way I've found is to tell webpack to ignore native modules using externals config, like this. It seems good enough, but you need to keep a list of native components up-to-date and run webpack as separate process.
The simplest solution is to let React Native expose a list of names of all native components, including user-defined. So it can be then used in webpack config like this:
externals: require('react-native').getComponents()
Also I can think of a webpack loader which is a thin wrapper around packager. It should be declared as the last loader in loaders pipeline (e.g. loaders: [ 'react-native-loader', 'babel-loader' ]). In this case packager should only do packaging and webpack-dev-server will be responsible of serving bundled output, thus it should be easier to integrate React Hot Loader, which is really cool!
Any thoughts?
The most painless way I've found is to tell webpack to ignore native modules using
externalsconfig, like this. It seems good enough, but you need to keep a list of native components up-to-date and run webpack as separate process.The simplest solution is to let React Native expose a list of names of all native components, including user-defined. So it can be then used in webpack config like this:
Also I can think of a webpack loader which is a thin wrapper around packager. It should be declared as the last loader in loaders pipeline (e.g.
loaders: [ 'react-native-loader', 'babel-loader' ]). In this case packager should only do packaging andwebpack-dev-serverwill be responsible of serving bundled output, thus it should be easier to integrate React Hot Loader, which is really cool!Any thoughts?