Skip to content
PluginStats

vite-plugin-json5 weekly downloads statistics

By sneakylenny · npm · Vite plugins

Plugin for allowing .json5 and .jsonc files to be loaded.

View on npm Fresh · Dec 6, 2026

vite-plugin-json5 has 83,247 recorded weekly downloads on npm, an increase of 56.3% over the past 30 days, ranking #666 of 3,247 tracked listings.

Weekly downloads
83,247
Official API · Dec 5, 2026
7-day growth
-12.4%
-11.8K weekly downloads
30-day growth
+56.3%
+30K weekly downloads
90-day growth
+65.1%
+32.8K weekly downloads
Rank
#666
▼ 35 in 7 days

About vite-plugin-json5

Vite JSON5 (and JSONC) plugin

npm npm GitHub Workflow Status License GitHub Repo stars

A Vite plugin that wraps json5 to allow .json5 and .jsonc files to be loaded.

Installation

1. Install the package
# pnpm
pnpm add -D vite-plugin-json5

# yarn
yarn add -D vite-plugin-json5

# npm
npm install -D vite-plugin-json5
2. Add it to your Vite config
// vite.config.js
import json5Plugin from "vite-plugin-json5";
// or
import { json5Plugin } from "vite-plugin-json5";

export default defineConfig({
    plugins: [json5Plugin()],
});
3. Done

.json5 and .jsonc files can now be imported directly. They are parsed by the json5 package and transformed into standard JavaScript modules.

Options

This plugin accepts the same options as the default JSON parser, plus a dts option for automatic TypeScript type generation:

interface Json5Options {
    /**
     * Generate a named export for every property of the JSON object
     * @default true
     */
    namedExports?: boolean;
    /**
     * Generate performant output as JSON.parse("stringified").
     * Enabling this will disable namedExports.
     * @default false
     */
    stringify?: boolean;
    /**
     * Automatically generate TypeScript declarations for imported
     * JSON5/JSONC files. See the TypeScript types section below.
     */
    dts?:
        | boolean
        // Aggregated mode (default): all declarations in one file
        | { sidecar?: false; literals?: boolean; outFile?: string }
        // Sidecar mode: one .d.ts file next to each source file
        | { sidecar: true; literals?: boolean };
}
TypeScript types

[!NOTE] In Vite's dev server, type declarations are generated lazily — the file is written the first time a JSON5/JSONC module is actually requested. Open the page once and the file persists on disk across server restarts. Running vite build always generates types upfront.

Enable the dts option to have the plugin automatically generate TypeScript declarations for every JSON5/JSONC file you import. No more any — you get full type safety and autocompletion, inferred directly from the file's contents.

// vite.config.ts
json5Plugin({ dts: true });

There are two modes:


Aggregated mode (default) — all declarations are collected into a single file at node_modules/@types/vite-plugin-json5/index.d.ts.

For auto-generated types to work, add "vite-plugin-json5" to your tsconfig.json "types" array:

{
  "compilerOptions": {
    "types": ["vite-plugin-json5"]
  }
}

If you already have a "types" array (e.g. "types": ["vite/client"]), append "vite-plugin-json5" to it.


Sidecar mode — writes a .d.ts file next to each source file (e.g. config.json5.d.ts beside config.json5). TypeScript picks these up automatically via module resolution — no tsconfig.json changes needed.

Example:

src/
├── config.json5
├── config.json5.d.ts   ← generated
├── theme.jsonc
└── theme.jsonc.d.ts    ← generated

Enable it with sidecar: true and add the generated files to your .gitignore:

json5Plugin({ dts: { sidecar: true } });

Add the signature of the generated files to the git ignore to prevent them from being pushed to your repository:

*.json5.d.ts
*.jsonc.d.ts

Literal types — by default, values are widened to their primitive type (string, number, boolean). Pass literals: true to use exact literal types instead:

json5Plugin({ dts: { literals: true } });
// Without literals (default)
export declare const version: string;

// With literals: true
export declare const version: "1.0.0";

Custom output path (aggregated mode only) — change where the aggregated file is written using outFile, relative to the Vite root:

json5Plugin({ dts: { outFile: "src/types/json5.d.ts" } });

Contributing

A guide for setting up the development environment to allow for easy contributions.

This repo uses proto for toolchain management and moon as the task runner.

  1. Install proto by following the proto install guide. Then install the required tools (Node.js, pnpm, and moon) from the repo root:

    $ proto install
    
  2. Install dependencies:

    $ pnpm install
    
  3. Make changes

  4. If the change is user-facing, add a changeset:

    $ pnpm changeset
    

    Commit the generated file under .changeset/ with your PR.

  5. Run tests

    $ moon run vite-plugin-json5:test
    
  6. Build when successful

    $ moon run vite-plugin-json5:build
    
  7. Run the playground to test the build

    $ moon run playground:dev
    

Releases are automated with changesets. Development lands on dev; merging dev → main (or committing directly to main) runs the release workflow, which opens a Version Packages PR — merge that to publish. See .changeset/README.md.

Description from the npm listing.

  • vite
  • vite-plugin
  • json5
  • jsonc
  • json

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

vite-plugin-json5 weekly downloads on npm, last 90 days: 83,247 weekly downloads as of Dec 5, 2026, +65.1% over 90 days.vite-plugin-json5Weekly downloads on npm · Last 90 days83,247downloads / week+65.1% over 90 days020K40K60K80K100KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
vite-plugin-json5 weekly downloads on npm, last 90 days: 83,247 weekly downloads as of Dec 5, 2026, +65.1% over 90 days.

7/30/90-day growth

vite-plugin-json5 weekly downloads growth on npm: -12.4% over 7 days, +56.3% over 30 days, +65.1% over 90 days.vite-plugin-json5Weekly downloads growth on npm83,247downloads / week now7-day growth-11,838 weekly downloads-12.4%30-day growth+29,979 weekly downloads+56.3%90-day growth+32,833 weekly downloads+65.1%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-json5 weekly downloads growth on npm: -12.4% over 7 days, +56.3% over 30 days, +65.1% over 90 days.

Ranking history

vite-plugin-json5 npm ranking history: currently #666 (by weekly downloads).vite-plugin-json5npm ranking · by weekly downloads · Last 90 days#666current rank#200#300#400#500#600#700#800Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-json5 npm ranking history: currently #666 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 34, #6 (overall #666)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 6, #11 (overall #111)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for vite-plugin-json5
Date (UTC)Weekly downloadsChange vs. previous
83,247-4.2K
87,422-5.8K
93,263-4.6K
97,848-547
98,395-126
98,521+2.5K
96,051+966
95,085+2.8K
92,295+6.8K
85,485+10.7K
74,778+7.4K
67,365+11.2K
56,163+2.1K
54,074—

Similar npm Vite plugins plugins

All 20 vite-plugin-json5 alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/vite-plugin-json5. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.