babel-plugin-react-native-web
Babel plugin for React Native for Web
Last updated 4 years ago by necolas .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install babel-plugin-react-native-web 
SYNC missed versions from official npm registry.

babel-plugin-react-native-web

npm version PRs Welcome

A Babel plugin that will alias react-native to react-native-web and exclude any modules not required by your app (keeping bundle size down).

Installation

npm install --save-dev babel-plugin-react-native-web

Usage

.babelrc

{
  "plugins": [
    ["react-native-web", { commonjs: true }]
  ]
}

You should configure the plugin to match the module format used by your bundler. Most modern bundlers will use a package's ES modules by default (i.e., if package.json has a module field). But if you need the plugin to rewrite import paths to point to CommonJS modules, you must set the commonjs option to true.

Example

NOTE: react-native-web internal paths are not stable and you must not rely on them. Always use the Babel plugin to optimize your build. What follows is an example of the rewrite performed by the plugin.

Before

import { StyleSheet, View } from 'react-native';

After

import StyleSheet from 'react-native-web/dist/exports/StyleSheet';
import View from 'react-native-web/dist/exports/View';

Current Tags

  • 0.19.13                                ...           latest (2 months ago)

142 Versions

  • 0.19.13                                ...           2 months ago
  • 0.19.12                                ...           7 months ago
  • 0.19.11                                ...           8 months ago
  • 0.19.10                                ...           a year ago
  • 0.19.9                                ...           a year ago
  • 0.19.8                                ...           a year ago
  • 0.19.7                                ...           a year ago
  • 0.19.6                                ...           a year ago
  • 0.19.5                                ...           2 years ago
  • 0.19.4                                ...           2 years ago
  • 0.19.3                                ...           2 years ago
  • 0.19.2                                ...           2 years ago
  • 0.19.1                                ...           2 years ago
  • 0.19.0                                ...           2 years ago
  • 0.18.12                                ...           2 years ago
  • 0.18.11                                ...           2 years ago
  • 0.18.10                                ...           2 years ago
  • 0.18.9                                ...           2 years ago
  • 0.18.8                                ...           2 years ago
  • 0.18.7                                ...           2 years ago
  • 0.18.6                                ...           2 years ago
  • 0.18.5                                ...           2 years ago
  • 0.18.4                                ...           2 years ago
  • 0.18.3                                ...           2 years ago
  • 0.18.2                                ...           2 years ago
  • 0.18.1                                ...           3 years ago
  • 0.18.0                                ...           3 years ago
  • 0.17.7                                ...           3 years ago
  • 0.17.6                                ...           3 years ago
  • 0.17.5                                ...           3 years ago
  • 0.17.4                                ...           3 years ago
  • 0.17.3                                ...           3 years ago
  • 0.17.2                                ...           3 years ago
  • 0.17.1                                ...           4 years ago
  • 0.17.0                                ...           4 years ago
  • 0.16.5                                ...           4 years ago
  • 0.16.4                                ...           4 years ago
  • 0.16.3                                ...           4 years ago
  • 0.16.2                                ...           4 years ago
  • 0.16.1                                ...           4 years ago
  • 0.16.0                                ...           4 years ago
  • 0.15.7                                ...           4 years ago
  • 0.15.6                                ...           4 years ago
  • 0.15.5                                ...           4 years ago
  • 0.15.4                                ...           4 years ago
  • 0.15.3                                ...           4 years ago
  • 0.15.2                                ...           4 years ago
  • 0.15.1                                ...           4 years ago
  • 0.15.0                                ...           4 years ago
  • 0.14.13                                ...           4 years ago
  • 0.14.12                                ...           4 years ago
  • 0.14.11                                ...           4 years ago
  • 0.14.10                                ...           4 years ago
  • 0.14.9                                ...           4 years ago
  • 0.14.8                                ...           4 years ago
  • 0.14.7                                ...           4 years ago
  • 0.14.6                                ...           4 years ago
  • 0.14.5                                ...           4 years ago
  • 0.14.4                                ...           4 years ago
  • 0.14.3                                ...           4 years ago
  • 0.14.2                                ...           4 years ago
  • 0.14.1                                ...           4 years ago
  • 0.14.0                                ...           4 years ago
  • 0.13.18                                ...           4 years ago
  • 0.13.17                                ...           4 years ago
  • 0.13.16                                ...           4 years ago
  • 0.13.15                                ...           4 years ago
  • 0.13.14                                ...           4 years ago
  • 0.13.13                                ...           4 years ago
  • 0.13.12                                ...           4 years ago
  • 0.13.11                                ...           4 years ago
  • 0.13.10                                ...           4 years ago
  • 0.13.9                                ...           4 years ago
  • 0.13.8                                ...           4 years ago
  • 0.13.7                                ...           4 years ago
  • 0.13.6                                ...           4 years ago
  • 0.13.5                                ...           4 years ago
  • 0.13.4                                ...           4 years ago
  • 0.13.3                                ...           4 years ago
  • 0.13.2                                ...           4 years ago
  • 0.13.1                                ...           4 years ago
  • 0.13.0                                ...           4 years ago
  • 0.12.3                                ...           5 years ago
  • 0.12.2                                ...           5 years ago
  • 0.12.1                                ...           5 years ago
  • 0.12.0                                ...           5 years ago
  • 0.12.0-rc.1                                ...           5 years ago
  • 0.11.7                                ...           5 years ago
  • 0.11.6                                ...           5 years ago
  • 0.11.5                                ...           5 years ago
  • 0.11.4                                ...           6 years ago
  • 0.11.3                                ...           6 years ago
  • 0.11.2                                ...           6 years ago
  • 0.11.1                                ...           6 years ago
  • 0.11.0                                ...           6 years ago
  • 0.10.1                                ...           6 years ago
  • 0.10.0                                ...           6 years ago
  • 0.9.13                                ...           6 years ago
  • 0.9.12                                ...           6 years ago
  • 0.9.11                                ...           6 years ago
  • 0.9.10                                ...           6 years ago
  • 0.9.9                                ...           6 years ago
  • 0.9.8                                ...           6 years ago
  • 0.9.7                                ...           6 years ago
  • 0.9.6                                ...           6 years ago
  • 0.9.5                                ...           6 years ago
  • 0.9.4                                ...           6 years ago
  • 0.9.3                                ...           6 years ago
  • 0.9.2                                ...           6 years ago
  • 0.9.1                                ...           6 years ago
  • 0.9.0                                ...           6 years ago
  • 0.8.11                                ...           6 years ago
  • 0.8.10                                ...           6 years ago
  • 0.8.9                                ...           6 years ago
  • 0.8.8                                ...           6 years ago
  • 0.8.7                                ...           6 years ago
  • 0.8.6                                ...           6 years ago
  • 0.8.5                                ...           6 years ago
  • 0.8.4                                ...           7 years ago
  • 0.8.3                                ...           7 years ago
  • 0.8.2                                ...           7 years ago
  • 0.8.1                                ...           7 years ago
  • 0.8.0                                ...           7 years ago
  • 0.7.3                                ...           7 years ago
  • 0.7.2                                ...           7 years ago
  • 0.7.1                                ...           7 years ago
  • 0.7.0                                ...           7 years ago
  • 0.6.1                                ...           7 years ago
  • 0.6.0                                ...           7 years ago
  • 0.5.4                                ...           7 years ago
  • 0.5.3                                ...           7 years ago
  • 0.5.2                                ...           7 years ago
  • 0.5.1                                ...           7 years ago
  • 0.5.0                                ...           7 years ago
  • 0.4.0                                ...           7 years ago
  • 0.3.3                                ...           7 years ago
  • 0.3.1                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
  • 0.3.0-rc.4                                ...           7 years ago
  • 0.3.0-rc.3                                ...           7 years ago
  • 0.3.0-rc.2                                ...           7 years ago
  • 0.3.0-rc.1                                ...           7 years ago
Maintainers (1)
Downloads
Total 2
Today 1
This Week 1
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE