Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antfu-collective/vite-plugin-inspect
Inspect the intermediate state of Vite plugins
https://github.com/antfu-collective/vite-plugin-inspect
vite vite-plugin
Last synced: about 14 hours ago
JSON representation
Inspect the intermediate state of Vite plugins
- Host: GitHub
- URL: https://github.com/antfu-collective/vite-plugin-inspect
- Owner: antfu-collective
- License: mit
- Created: 2021-08-16T04:17:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-09T09:26:55.000Z (15 days ago)
- Last Synced: 2025-01-16T14:38:27.668Z (8 days ago)
- Topics: vite, vite-plugin
- Language: Vue
- Homepage:
- Size: 2.06 MB
- Stars: 1,341
- Watchers: 6
- Forks: 81
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-inspect
[![NPM version](https://img.shields.io/npm/v/vite-plugin-inspect?color=a1b858&label=)](https://www.npmjs.com/package/vite-plugin-inspect)
Inspect the intermediate state of Vite plugins. Useful for debugging and authoring plugins.
## Install
```bash
npm i -D vite-plugin-inspect
```> [!NOTE]
>
> v10.x requires **Vite v6.0.1** or above.
>
> For Vite v2 to v5, use v0.8.x of `vite-plugin-inspect`. If you want to use it with both Vite 6 and below, you can still use v0.8.x, it's forwards compatible.Add plugin to your `vite.config.ts`:
```ts
// vite.config.ts
import Inspect from 'vite-plugin-inspect'export default {
plugins: [
Inspect()
],
}
```Then run `npm run dev` and visit [localhost:5173/__inspect/](http://localhost:5173/__inspect/) to inspect the modules.
## Build Mode
To inspect transformation in build mode, you can pass the `build: true` option:
```ts
// 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) License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)