Rollup plugin that recursively transforms JSON values into their dot-separated key paths, useful for i18n key generation or object value replacement. Latest version 1.2.0 (2025-11-22) requires rollup >= 2. The package has seen recent maintenance including dependency updates and path restructuring. It is part of a monorepo with webpack loader and Jest transformer equivalents. Key differentiators: designed specifically for Rollup, outputs JSON with key paths, supports custom prefix via options.
npm install rollup-plugin-json-map-keysVerified import paths — ran on the pinned version, not inferred.
Configures Rollup to replace JSON values with dot-separated key paths, demonstates typical usage with @rollup/plugin-json.
Update to rollup-plugin-json-map-keys@1.2.0 or later; verify lockfile for correct package.
Add @rollup/plugin-json to your Rollup plugins list.
Review prefix syntax in README for version 1.2.0.
Ensure your JSON structure has intended leaf values (strings) to be replaced.
Run 'npm install rollup-plugin-json-map-keys --save-dev'
Use ES import: 'import jsonMapKeys from 'rollup-plugin-json-map-keys'' or use 'const jsonMapKeys = require('rollup-plugin-json-map-keys').default'Install and add @rollup/plugin-json to plugins array.