版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1 год назад
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # vite-plugin-inspect
  2. [![NPM version](https://img.shields.io/npm/v/vite-plugin-inspect?color=a1b858&label=)](https://www.npmjs.com/package/vite-plugin-inspect)
  3. Inspect the intermediate state of Vite plugins. Useful for debugging and authoring plugins.
  4. <img width="1304" src="https://user-images.githubusercontent.com/46585162/134683677-487e3e03-fa6b-49ad-bde0-520ebb641a96.png">
  5. ![](https://s9.gifyu.com/images/Kapture-2021-09-11-at-07.33.36.gif)
  6. ## Install
  7. ```bash
  8. npm i -D vite-plugin-inspect
  9. ```
  10. > Since `vite-plugin-inspect@v0.7.0`, Vite v3.1 or above is required.
  11. Add plugin to your `vite.config.ts`:
  12. ```ts
  13. // vite.config.ts
  14. import Inspect from 'vite-plugin-inspect'
  15. export default {
  16. plugins: [
  17. Inspect()
  18. ],
  19. }
  20. ```
  21. Then visit [localhost:3000/__inspect/](http://localhost:3000/__inspect/) to inspect the modules.
  22. ## Build Mode
  23. To inspect transformation in build mode, you can pass the `build: true` option:
  24. ```ts
  25. // vite.config.ts
  26. import Inspect from 'vite-plugin-inspect'
  27. export default {
  28. plugins: [
  29. Inspect({
  30. build: true,
  31. outputDir: '.vite-inspect'
  32. })
  33. ],
  34. }
  35. ```
  36. 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.
  37. ## Sponsors
  38. <p align="center">
  39. <a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
  40. <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
  41. </a>
  42. </p>
  43. ## License
  44. [MIT](./LICENSE) License © 2021 [Anthony Fu](https://github.com/antfu)