Skip to content

Integration with webpack #395

@roman01la

Description

@roman01la

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions