Skip to content

Commit e3609ff

Browse files
committed
fix: try not bundling vue and vite
1 parent c4c1c47 commit e3609ff

9 files changed

Lines changed: 33 additions & 38 deletions

File tree

examples/plugin-a11y-checker/src/node/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PluginWithDevTools } from '@vitejs/devtools-kit'
22
import fs from 'node:fs'
33
import { fileURLToPath } from 'node:url'
4-
import { normalizePath } from 'vite'
4+
import { normalize } from 'pathe'
55

66
function resolveClientScript(): string | undefined {
77
const paths = [
@@ -29,7 +29,7 @@ export function A11yCheckerPlugin(): PluginWithDevTools {
2929
icon: 'ph:wheelchair-duotone',
3030
category: 'web',
3131
action: {
32-
importFrom: `/@fs/${normalizePath(clientScript)}`,
32+
importFrom: `/@fs/${normalize(clientScript)}`,
3333
},
3434
})
3535

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "module",
33
"version": "0.1.5",
44
"private": true,
5-
"packageManager": "pnpm@11.0.0-beta.2",
5+
"packageManager": "pnpm@10.32.1",
66
"scripts": {
77
"build": "turbo run build",
88
"build:debug": "NUXT_DEBUG_BUILD=true pnpm -r run build",
@@ -75,7 +75,7 @@
7575
"vite-plugin-vue-tracer": "catalog:playground",
7676
"vitest": "catalog:testing",
7777
"vitest-package-exports": "catalog:testing",
78-
"vue": "catalog:frontend",
78+
"vue": "catalog:deps",
7979
"vue-tsc": "catalog:devtools",
8080
"yaml": "catalog:testing"
8181
},

packages/core/package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"perfect-debounce": "catalog:deps",
7171
"sirv": "catalog:deps",
7272
"tinyexec": "catalog:deps",
73+
"vue": "catalog:deps",
7374
"ws": "catalog:deps"
7475
},
7576
"devDependencies": {
@@ -84,7 +85,7 @@
8485
"typescript": "catalog:devtools",
8586
"unplugin-vue": "catalog:build",
8687
"vite": "catalog:build",
87-
"vue": "catalog:frontend",
88+
"vue": "catalog:deps",
8889
"vue-router": "catalog:playground",
8990
"vue-tsc": "catalog:devtools"
9091
},
@@ -93,20 +94,14 @@
9394
"@clack/prompts": "1.1.0",
9495
"@json-render/core": "0.13.0",
9596
"@json-render/vue": "0.13.0",
96-
"@vue/reactivity": "3.5.30",
97-
"@vue/runtime-core": "3.5.30",
98-
"@vue/runtime-dom": "3.5.30",
99-
"@vue/shared": "3.5.30",
10097
"@vueuse/core": "14.2.1",
10198
"@vueuse/shared": "14.2.1",
10299
"@xterm/addon-fit": "0.11.0",
103100
"@xterm/xterm": "6.0.0",
104101
"ansis": "4.2.0",
105-
"csstype": "3.2.3",
106102
"dompurify": "3.3.3",
107103
"get-port-please": "3.2.0",
108104
"sisteransi": "1.0.5",
109-
"vue": "3.5.30",
110105
"zod": "4.3.6"
111106
}
112107
}

packages/core/src/node/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { DevToolsNodeContext, JsonRenderer, JsonRenderSpec } from '@vitejs/
22
import type { ResolvedConfig, ViteDevServer } from 'vite'
33
import { createDebug } from 'obug'
44
import { debounce } from 'perfect-debounce'
5-
import { searchForWorkspaceRoot } from 'vite'
65
import { ContextUtils } from './context-utils'
76
import { DevToolsDockHost } from './host-docks'
87
import { RpcFunctionsHost } from './host-functions'
@@ -32,6 +31,7 @@ export async function createDevToolsContext(
3231
): Promise<DevToolsNodeContext> {
3332
const cwd = viteConfig.root
3433

34+
const { searchForWorkspaceRoot } = await import('vite')
3535
const context: DevToolsNodeContext = {
3636
cwd,
3737
workspaceRoot: searchForWorkspaceRoot(cwd) ?? cwd,

packages/core/src/node/plugins/injection.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Plugin } from 'vite'
2-
import { join } from 'node:path'
32
import process from 'node:process'
4-
import { normalizePath } from 'vite'
3+
import { join, normalize } from 'pathe'
54
import { dirDist } from '../../dirs'
65

76
export function DevToolsInjection(): Plugin {
@@ -10,8 +9,8 @@ export function DevToolsInjection(): Plugin {
109
enforce: 'post',
1110
transformIndexHtml() {
1211
const fileUrl = process.env.VITE_DEVTOOLS_LOCAL_DEV
13-
? normalizePath(join(dirDist, '..', 'src/client/inject/index.ts'))
14-
: normalizePath(join(dirDist, 'client/inject.js'))
12+
? normalize(join(dirDist, '..', 'src/client/inject/index.ts'))
13+
: normalize(join(dirDist, 'client/inject.js'))
1514
return [
1615
{
1716
tag: 'script',

packages/core/src/node/standalone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { DevToolsNodeContext } from '@vitejs/devtools-kit'
22
import type { Plugin, ResolvedConfig } from 'vite'
33
import process from 'node:process'
4-
import { resolveConfig } from 'vite'
54
import { createDevToolsContext } from './context'
65
import { DevTools } from './plugins'
76

@@ -23,6 +22,7 @@ export async function startStandaloneDevTools(options: StandaloneDevToolsOptions
2322
mode = 'production',
2423
} = options
2524

25+
const { resolveConfig } = await import('vite')
2626
const resolved = await resolveConfig(
2727
{
2828
configFile: options.config,

packages/core/tsdown.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default defineConfig({
1616
],
1717
deps: {
1818
neverBundle: [
19+
'vite',
1920
'@vitejs/devtools/client/webcomponents',
2021
/^node:/,
2122
],

pnpm-lock.yaml

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ catalogs:
7777
unconfig: ^7.5.0
7878
unstorage: ^1.17.4
7979
valibot: ^1.3.1
80+
vue: ^3.5.30
8081
webext-bridge: ^6.0.1
8182
ws: ^8.20.0
8283
devtools:
@@ -132,7 +133,6 @@ catalogs:
132133
theme-vitesse: ^1.0.0
133134
ua-parser-modern: ^0.1.1
134135
vite-hot-client: ^2.1.0
135-
vue: ^3.5.30
136136
vue-virtual-scroller: ^2.0.0-beta.10
137137
icons:
138138
'@iconify-json/carbon': ^1.2.19

0 commit comments

Comments
 (0)