Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alexandernanberg/babel-plugin-fbt-import

Plugin to automatically import FBT
https://github.com/alexandernanberg/babel-plugin-fbt-import

Last synced: 2 days ago
JSON representation

Plugin to automatically import FBT

Awesome Lists containing this project

README

        

# `babel-plugin-fbt-import`

A babel plugin to automatically import `fbt`.

## Installation

```
$ npm install babel-plugin-fbt-import --save-dev
```

## Configuration

Add "babel-plugin-fbt-import" to the plugins list. It's **important** that is added before `babel-plugin-fbt` and `babel-plugin-fbt-runtime`, otherwise the latter will throw an error.

```json
{
"plugins": [
"babel-plugin-fbt-import",
"babel-plugin-fbt",
"babel-plugin-fbt-runtime"
]
}
```

### Example

Input

```js
function App() {
return (



Hello



)
}

export default App
```

Output

```js
import { fbt } from 'fbt'

function App() {
return (



Hello



)
}

export default App
```

## License

[MIT](/license)