Skip to content

Commit

Permalink
perf(lib): reduce backtrack when injecting esbuild helpers (#8110)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored and patak-dev committed May 11, 2022
1 parent 992aee2 commit e5556ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/esbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import { searchForWorkspaceRoot } from '..'
const debug = createDebugger('vite:esbuild')

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

let server: ViteDevServer

Expand Down

0 comments on commit e5556ab

Please sign in to comment.