Skip to content

Commit

Permalink
This is a workaround, so it may not be the optimal solution.
Browse files Browse the repository at this point in the history
  • Loading branch information
natsumesou committed Mar 1, 2024
1 parent 34ecd67 commit 717b19a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/dev-server/src/dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { minimatch } from 'minimatch'
import type { Plugin as VitePlugin, ViteDevServer, Connect } from 'vite'
import { getEnv as cloudflarePagesGetEnv } from './cloudflare-pages/index.js'
import type { Env, Fetch, EnvFunc, Plugin } from './types.js'
import { WebSocketPair } from 'miniflare';

export type DevServerOptions = {
entry?: string
Expand Down Expand Up @@ -88,6 +89,10 @@ export function devServer(options?: DevServerOptions): VitePlugin {
res: http.ServerResponse,
next: Connect.NextFunction
): Promise<void> {
Object.assign(
globalThis,
{ WebSocketPair }
)
const exclude = options?.exclude ?? defaultOptions.exclude

for (const pattern of exclude) {
Expand Down

0 comments on commit 717b19a

Please sign in to comment.