Skip to content

Commit af9b6a8

Browse files
author
cod1k
committed
Update regex to handle URLs with '?import' query param
This change enhances the URL matching regex in the Vite plugin to allow handling of requests containing the '?import' query parameter. It ensures better compatibility with specific module imports during development.
1 parent 6ce254b commit af9b6a8

File tree

1 file changed

+1
-1
lines changed
  • packages/vite-plugin-cloudflare/src

1 file changed

+1
-1
lines changed

packages/vite-plugin-cloudflare/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export function cloudflare(pluginConfig: PluginConfig = {}): vite.Plugin[] {
360360
await initRunners(resolvedPluginConfig, viteDevServer, miniflare);
361361

362362
const viteHandle =
363-
/^https?:\/\/[^/]+\/(?:(?:src|node_modules[^\/]*?\/)|@\w+)/i;
363+
/^https?:\/\/[^/]+\/(?:(?:src|node_modules[^\/]*?\/)|@\w+)|\?import$/i;
364364
const middleware = createMiddleware(
365365
async ({ request, passThrough }) => {
366366
if (viteHandle.test(request.url)) {

0 commit comments

Comments
 (0)