/unplugin-json-dts

Primary LanguageTypeScriptMIT LicenseMIT

unplugin-json-dts

NPM version

Automatically generate better typings for json files. Supports json modules.

Comparision of before and after screenshots

Installation

npm i unplugin-json-dts -D
Vite
// vite.config.ts
import jsonDts from 'unplugin-json-dts/vite'
export default defineConfig({
  plugins: [
    jsonDts(),
  ],
})


Rollup
// rollup.config.js
import jsonDts from 'unplugin-json-dts/rollup'
export default {
  plugins: [
    jsonDts(),
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-json-dts/webpack')()
  ]
}