@rollup/plugin-json

  • Version 6.1.0
  • Published
  • 10.7 kB
  • 1 dependency
  • MIT license

Install

npm i @rollup/plugin-json
yarn add @rollup/plugin-json
pnpm add @rollup/plugin-json

Overview

Convert .json files to ES6 modules

Index

Functions

function json

json: (options?: RollupJsonOptions) => Plugin;
  • Convert .json files to ES6 modules

Interfaces

interface RollupJsonOptions

interface RollupJsonOptions {}

    property compact

    compact?: boolean;
    • Ignores indent and generates the smallest code false

    property exclude

    exclude?: FilterPattern;
    • All JSON files will be parsed by default, but you can also specifically exclude files

    property include

    include?: FilterPattern;
    • All JSON files will be parsed by default, but you can also specifically include files

    property indent

    indent?: string;
    • Specify indentation for the generated default export '\t'

    property namedExports

    namedExports?: boolean;
    • Generate a named export for every property of the JSON object true

    property preferConst

    preferConst?: boolean;
    • For tree-shaking, properties will be declared as variables, using either var or const. false

    Package Files (1)

    Dependencies (1)

    Dev Dependencies (4)

    Peer Dependencies (1)

    Badge

    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@rollup/plugin-json.

    • Markdown
      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@rollup/plugin-json)
    • HTML
      <a href="https://www.jsdocs.io/package/@rollup/plugin-json"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>