Skip to content

Commit 1664e4a

Browse files
committed
refactor: use vite internal devtools config
1 parent dd05d7a commit 1664e4a

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

packages/core/src/node/ws.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function createWsServer(options: CreateWsServerOptions) {
3434
const context = options.context
3535
const contextInternal = getInternalContext(context)
3636

37-
const isClientAuthDisabled = context.mode === 'build' || context.viteConfig.devtools?.clientAuth === false || process.env.VITE_DEVTOOLS_DISABLE_CLIENT_AUTH === 'true'
37+
const isClientAuthDisabled = context.mode === 'build' || context.viteConfig.devtools?.config?.clientAuth === false || process.env.VITE_DEVTOOLS_DISABLE_CLIENT_AUTH === 'true'
3838
if (isClientAuthDisabled) {
3939
console.warn('[Vite DevTools] Client authentication is disabled. Any browser can connect to the devtools and access to your server and filesystem.')
4040
}

packages/kit/src/types/vite-augment.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,6 @@ declare module 'vite' {
66
interface Plugin {
77
devtools?: DevToolsPluginOptions
88
}
9-
interface UserConfig {
10-
devtools?: ViteConfigDevtoolsOptions
11-
}
12-
}
13-
14-
export interface ViteConfigDevtoolsOptions {
15-
/**
16-
* Disable client authentication.
17-
*
18-
* Beware that if you disable client authentication,
19-
* any browsers can connect to the devtools and access to your server and filesystem.
20-
* (including other devices, if you open server `host` option to LAN or WAN)
21-
*
22-
* @default true
23-
*/
24-
clientAuth?: boolean
259
}
2610

2711
export interface PluginWithDevTools extends Plugin {

packages/rolldown/src/nuxt.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ export default defineNuxtConfig({
8989
vite: {
9090
base: BASE,
9191
build: {
92-
rolldownOptions: {
93-
devtools: {},
94-
},
9592
minify: NUXT_DEBUG_BUILD ? false : undefined,
9693
cssMinify: false,
9794
},
@@ -132,6 +129,7 @@ export default defineNuxtConfig({
132129
clientAuth: false,
133130
},
134131
plugins: [
132+
// @ts-expect-error skip type check
135133
NUXT_DEBUG_BUILD ? Inspect({ build: true }) : null,
136134
],
137135
},

0 commit comments

Comments
 (0)