0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

Disable server.ws vite config for loading config files (#11744)

This commit is contained in:
Bjorn Lu 2024-08-19 22:52:42 +08:00 committed by GitHub
parent 7ab0e601fd
commit b67742961a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 3 deletions

View file

@ -0,0 +1,6 @@
---
'astro': patch
'@astrojs/db': patch
---
Disables the WebSocket server when creating a Vite server for loading config files

View file

@ -7,7 +7,7 @@ import { debug } from '../logger/core.js';
async function createViteServer(root: string, fs: typeof fsType): Promise<ViteDevServer> {
const viteServer = await createServer({
configFile: false,
server: { middlewareMode: true, hmr: false, watch: null },
server: { middlewareMode: true, hmr: false, watch: null, ws: false },
optimizeDeps: { noDiscovery: true },
clearScreen: false,
appType: 'custom',

View file

@ -169,7 +169,7 @@ async function syncContentCollections(
const tempViteServer = await createServer(
await createVite(
{
server: { middlewareMode: true, hmr: false, watch: null },
server: { middlewareMode: true, hmr: false, watch: null, ws: false },
optimizeDeps: { noDiscovery: true },
ssr: { external: [] },
logLevel: 'silent',

View file

@ -222,7 +222,7 @@ async function executeSeedFile({
async function getTempViteServer({ viteConfig }: { viteConfig: UserConfig }) {
const tempViteServer = await createServer(
mergeConfig(viteConfig, {
server: { middlewareMode: true, hmr: false, watch: null },
server: { middlewareMode: true, hmr: false, watch: null, ws: false },
optimizeDeps: { noDiscovery: true },
ssr: { external: [] },
logLevel: 'silent',