Skip to content

Commit

Permalink
fix: revert #757, pin vite-plugin-inspect version
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 3, 2024
1 parent f414441 commit a399082
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 49 deletions.
1 change: 0 additions & 1 deletion packages/devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"tinyglobby": "catalog:",
"unimport": "catalog:",
"vite-plugin-inspect": "catalog:",
"vite-plugin-inspect-legacy": "npm:[email protected]",
"vite-plugin-vue-inspector": "catalog:",
"which": "catalog:",
"ws": "catalog:"
Expand Down
18 changes: 9 additions & 9 deletions packages/devtools/src/integrations/vite-inspect.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import type { Plugin } from 'vite'
import type { ViteInspectAPI, ViteInspectOptions } from 'vite-plugin-inspect'
import type { ViteInspectAPI, Options as ViteInspectOptions } from 'vite-plugin-inspect'
import type { NuxtDevtoolsServerContext } from '../types'
import { addCustomTab } from '@nuxt/devtools-kit'
import { addVitePlugin } from '@nuxt/kit'

export async function createVitePluginInspect(options?: ViteInspectOptions): Promise<Plugin> {
const { version } = await import('vite')
const major = Number.parseInt(version.split('.')[0], 10)
// const { version } = await import('vite')
// const major = Number.parseInt(version.split('.')[0], 10)

if (major < 6) {
return await import('vite-plugin-inspect-legacy').then(r => r.default(options))
}
else {
return await import('vite-plugin-inspect').then(r => r.default(options))
}
// if (major < 6) {
// return await import('vite-plugin-inspect-legacy').then(r => r.default(options))
// }
// else {
return await import('vite-plugin-inspect').then(r => r.default(options))
// }
}

export async function setup({ nuxt, rpc }: NuxtDevtoolsServerContext) {
Expand Down
45 changes: 7 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ catalog:
vis-network: ^9.1.9
vite: ^6.0.2
vite-hot-client: ^0.2.4
vite-plugin-inspect: ^0.10.3
vite-plugin-inspect: ~0.8.8
vite-plugin-vue-inspector: 5.1.3
vitest: ^2.1.8
vue: ^3.5.13
Expand Down

0 comments on commit a399082

Please sign in to comment.