https://github.com/antfu-collective/vite-plugin-inspect Vite Plugin Inspect 是由 Antfu 开发的一款 Vite 插件,它的目标是让 Vue、React 等框架的开发者能够更容易地查看和理解构建过程中经过转换的源码。通过集成到 Vite 环境中,Inspect 插件可以在浏览器的开发者工具中直接展示 ES 模块、CSS、甚至是编译后的...
name: 'vite-plugin-xxx', //插件名称 load(code) { // 钩子逻辑 }, } 1. 2. 3. 4. 5. 6. 在插件命名方式上,如果插件是一个 npm 包,在package.json中的包命名也推荐以vite-plugin开头。一般情况下因为要考虑到外部传参,我们不会直接写一个对象,而是实现一个返回插件对象的工厂函数,如下代码所示: ...
// vite.config.tsimportInspectfrom'vite-plugin-inspect'exportdefault{plugins:[Inspect({build:true,outputDir:'.vite-inspect'})],} After runningvite build, the inspector client will be generated under.vite-inspect, where you can usenpx serve .vite-inspectto check the result. ...
vite-plugin-inspect/dist/index.d.ts Version: 1.96 kBTypeScriptView Raw 1 import { Plugin } from 'vite'; 2 import { Awaitable } from '@antfu/utils'; 3 import { StackFrame } from 'error-stack-parser-es'; 4 import { O as Options } from './shared/vite-plugin-inspect.6a105d...
vite-plugin-inspect 现在有更多与性能相关的功能,可以帮助开发者确定哪些插件或中间件是应用性能的瓶颈。页面加载后使用 vite --profile(然后按 p)将保存 devServer 启动的 CPU 配置文件。可以在应用中将它们作为 speedscope 打开以识别性能问题。为什么 Vite 4.3 这么快?更智能的解析策略 Vite会将所有接收到的...
Inspect:Inspect 与 vite-plugin-inspect 集成,可以检查 Vite 的转换步骤。 Inspector:Inspector 与 vite-plugin-vue-inspector 集成,可以检查应用的 DOM 树,并查看渲染它的组件,这样可以更轻松地找到需要进行更改的位置。 独立窗口:Vue DevTools 可以作为一个独立的窗口运行,当你想在小屏幕上调试应用时,它非常有帮助...
vite-plugin-inspect 现在有更多与性能相关的功能,可以帮助开发者确定哪些插件或中间件是应用性能的瓶颈。页面加载后使用 vite --profile(然后按 p)将保存 devServer 启动的 CPU 配置文件。可以在应用中将它们作为 speedscope 打开以识别性能问题。 接下来,Vite 团队决定今年做一个 Vite 主版本,以配合 9 月 Node....
vite-plugin-inspect/dist/index.mjs Version: 39 kBJavaScriptView Raw 1 import process from 'node:process'; 2 import sirv from 'sirv'; 3 import c from 'picocolors'; 4 import { dirname, resolve, isAbsolute, join } from 'node:path'; ...
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 gener...
vite-plugin-inspect:vite-plugin-inspect从 0.7.20 版本开始支持显示插件的钩子时间,并且将来会有更多的跑分图。 vite-plugin-warmup:预热您的 Vite 服务器,并提升页面加载速度! - End -