Skip to content

Commit e5556ab

Browse files
sapphi-redpatak-dev
authored andcommitted
perf(lib): reduce backtrack when injecting esbuild helpers (#8110)
1 parent 992aee2 commit e5556ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/vite/src/node/plugins/esbuild.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import { searchForWorkspaceRoot } from '..'
2727
const debug = createDebugger('vite:esbuild')
2828

2929
const INJECT_HELPERS_IIFE_RE =
30-
/(.*)(var [^\s]+=function\(.*\){"use strict";)(.*)/
30+
/(.*)(var [^\s]+=function\([^)]*?\){"use strict";)(.*)/
3131
const INJECT_HELPERS_UMD_RE =
32-
/(.*)(\(function\(.*\){.+amd.+function\(.*\){"use strict";)(.*)/
32+
/(.*)(\(function\([^)]*?\){.+amd.+function\([^)]*?\){"use strict";)(.*)/
3333

3434
let server: ViteDevServer
3535

0 commit comments

Comments
 (0)