# babel-plugin-inline-json-import

> Inlines JSON file imports straight into JS code

Latest version **0.3.2** (published 2019-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-inline-json-import
pnpm add babel-plugin-inline-json-import
yarn add babel-plugin-inline-json-import
bun add babel-plugin-inline-json-import
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2019-03-07 |
| First published | 2016-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 16.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Bryan Yap |
| Maintainers | yggie |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-inline-json-import
- Repository: https://github.com/yggie/babel-plugin-inline-json-import
- Homepage: https://github.com/yggie/babel-plugin-inline-json-import#readme
- Issues: https://github.com/yggie/babel-plugin-inline-json-import/issues
- npm.io page: https://npm.io/package/babel-plugin-inline-json-import

## Dependencies (1)

- [decache](https://npm.io/package/decache.md) ^4.5.1

## Recent versions

- 0.3.2 (latest) — 2019-03-07
- 0.3.1 — 2018-09-20
- 0.3.0 — 2018-09-13
- 0.2.1 — 2017-03-21
- 0.2.0 — 2017-01-20
- 0.1.6 — 2016-11-11
- 0.1.5 — 2016-10-13
- 0.1.4 — 2016-10-13
- 0.1.3 — 2016-10-13
- 0.1.2 — 2016-10-13
- 0.1.1 — 2016-10-12
- 0.1.0 — 2016-10-12

## README

# babel-plugin-inline-json-import
[![NPM](https://nodei.co/npm/babel-plugin-inline-json-import.png?downloads=true&stars=true)](https://npmjs.org/package/babel-plugin-inline-json-import)

[![Build Status](https://travis-ci.org/yggie/babel-plugin-inline-json-import.svg?branch=master)](https://travis-ci.org/yggie/babel-plugin-inline-json-import)

A babel pre-processor that inlines all imports of JSON files straight into your
JavaScript files.

## Example

Given the following JSON file:

```json
{
  "foo": "bar"
}
```

The plugin will transform the following statement:

```js
import json from './path/to/file.json';
```

or

to:

```js
const json = { foo: "bar" };
```

Simple as that! Both `require` and `import` are supported.

## Installation

Install the plugin through `npm`, you will also need `babel` installed for
obvious reasons:

```sh
$ npm install --save-dev babel-plugin-inline-json-import
```

Add `babel-plugin-inline-json-import` to the list of plugins. If you are using a
`.babelrc` file, the file should have an entry that looks like this:

```json
{
  "plugins": [
    ["inline-json-import", {}]
  ]
}
```

## Usage

This should work straight out of the box without any configuration.

## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request =)

## License
This project is licensed under the MIT License - see the [LICENSE](/LICENSE)
file for details

---
_Source: https://npm.io/package/babel-plugin-inline-json-import · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
