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 committed May 11, 2022
1 parent 8148f67 commit b993c5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/esbuild.ts
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 b993c5f

Please sign in to comment.