# react-native-jsonc-asset-plugin

> Asset plugin for compress jsonc in React Native

Latest version **0.0.1** (published 2022-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-jsonc-asset-plugin
pnpm add react-native-jsonc-asset-plugin
yarn add react-native-jsonc-asset-plugin
bun add react-native-jsonc-asset-plugin
```

## 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.0.1 |
| Published | 2022-04-21 |
| First published | 2022-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | malacca |
| Keywords | react-native, metro, compress, jsonc, assetPlugin |

## Links

- npm: https://www.npmjs.com/package/react-native-jsonc-asset-plugin
- Repository: https://github.com/malacca/react-native-jsonc-asset-plugin
- Issues: https://github.com/malacca/react-native-jsonc-asset-plugin/issues
- npm.io page: https://npm.io/package/react-native-jsonc-asset-plugin

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.1 (latest) — 2022-04-21

## README

# react-native-jsonc-asset-plugin


## Usage

### Step 1: Install

```sh
yarn add -D react-native-jsonc-asset-plugin
```

or

```sh
npm install --save-dev react-native-jsonc-asset-plugin
```

### Step 2: Configure `metro.config.js`

For example;

```js
const {getDefaultConfig} = require('metro-config');

module.exports = (async () => {
  const {resolver: {assetExts}} = await getDefaultConfig();
  return {
    resolver: {
      assetExts: [...assetExts, 'jsonc', 'json5'],
    },
    transformer: {
      getTransformOptions: async () => ({
        transform: {
          inlineRequires: true,
          experimentalImportSupport: false,
        },
      }),
      assetPlugins: ['react-native-jsonc-asset-plugin'],
      jsoncAssetPlugin: {
        test: /\.(jsonc|json5)$/,
        tempDir: '.jsonc',
      },
    },
  };
})();
```

---
_Source: https://npm.io/package/react-native-jsonc-asset-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
