@invertase/babel-preset-react-native-syntax

<p align="center"> <a href="https://invertase.io"> <img src="https://static.invertase.io/assets/invertase-logo-small.png"><br/> </a> <h2 align="center">Babel Preset React Native Syntax</h2> </p>

Stats

stars ๐ŸŒŸissues โš ๏ธupdated ๐Ÿ› created ๐Ÿฃsize ๐Ÿ‹๏ธโ€โ™€๏ธ
50Sep 3, 2018Sep 3, 2018Minified + gzip package size for @invertase/babel-preset-react-native-syntax in KB

Readme


Babel Preset React Native Syntax

NPM downloads NPM version License Chat Follow on Twitter

This preset includes the latest syntax plugins as specified in babel-preset-react-native.

Latest supported React Native version: ^0.56.0

Latest supported Metro version: ^0.45.0

Latest supported Babel version: ^7.0.0


npm i @invertase/babel-preset-react-native-syntax


This is useful for React Native libraries that want to use Babel plugins that may not be supported by React Native's default preset.

Additionally this allows editing/viewing library source from within node_modules (useful for debugging) as there's no transformation of library code (unless you add any additional transform plugins).

Example Usage

{
  "presets": ["@invertase/react-native-syntax"],
  "plugins": [
    "transform-decorators-legacy"
  ]
}

Options

flow -> 'strip' | 'comment'

Optional: Whether to transform flow syntax by striping it out entirely or comment it out but preserve the /* @flow */ directive and still be able to use flow.

  • strip -> @babel/plugin-transform-flow-strip-types
  • comment -> @babel/plugin-transform-flow-comments
  • undefined -> do nothing - flow syntax remains untouched

Example

{
  "presets": [
    "@invertase/react-native-syntax",
    {
      "flow": "comment"
    }
  ],
  "plugins": [
    "transform-decorators-legacy"
  ]
}

Credits

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.