Skip to content

Commit

Permalink
Disable server.ws vite config for loading config files (#11744)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Aug 19, 2024
1 parent 7ab0e60 commit b677429
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/weak-masks-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'astro': patch
'@astrojs/db': patch
---

Disables the WebSocket server when creating a Vite server for loading config files
2 changes: 1 addition & 1 deletion packages/astro/src/core/config/vite-load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/db/src/core/integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit b677429

Please sign in to comment.