Vite Plugin Inspect Save

Inspect the intermediate state of Vite plugins

Project README

vite-plugin-inspect

NPM version

Inspect the intermediate state of Vite plugins. Useful for debugging and authoring plugins.

Install

npm i -D vite-plugin-inspect

Since [email protected], Vite v3.1 or above is required.

Add plugin to your vite.config.ts:

// vite.config.ts
import Inspect from 'vite-plugin-inspect'

export default {
  plugins: [
    Inspect()
  ],
}

Then visit localhost:3000/__inspect/ to inspect the modules.

Build Mode

To inspect transformation in build mode, you can pass the build: true option:

// vite.config.ts
import Inspect from 'vite-plugin-inspect'

export default {
  plugins: [
    Inspect({
      build: true,
      outputDir: '.vite-inspect'
    })
  ],
}

After running vite build, the inspector client will be generated under .vite-inspect, where you can use npx serve .vite-inspect to check the result.

Sponsors

License

MIT License © 2021 Anthony Fu

Open Source Agenda is not affiliated with "Vite Plugin Inspect" Project. README Source: antfu/vite-plugin-inspect
Stars
591
Open Issues
5
Last Commit
1 week ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating