An esbuild plugin for cleaning JSON files during the build process. It supports removing top-level tags (like schema references), minifying output, and customizing indentation. Current version is 0.1.3, released as an early-stage tool with peer dependency on esbuild ^0.27.2. It differentiates by being a minimal, focused plugin for JSON cleanup in esbuild builds, with TypeScript support and dual ESM/CJS exports. Suitable for workflows that need to strip metadata from JSON files before bundling.
npm install esbuild-plugin-json-cleanerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure the plugin to remove 'schema' and specific tags from a JSON file, with custom indentation.
Use import syntax or use the default export via require('esbuild-plugin-json-cleaner').default.Update esbuild to version ^0.27.2 or later.
Use Node.js version 24 or higher.
Use multiple plugin instances for multiple files or manually iterate.
Specify full top-level keys to remove.
Use import JSONCleanerPlugin from 'esbuild-plugin-json-cleaner' or const JSONCleanerPlugin = require('esbuild-plugin-json-cleaner').defaultRun npm install esbuild --save-dev
Check that src path is relative to the project root and file exists