Skip to content

Commit

Permalink
perf(lib): improve helper inject regex (fixes vitejs#10900)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 14, 2022
1 parent 59f35c8 commit dc06c5b
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 =
/^(.*)((?:const|var) \S+=function\([^)]*\)\{"use strict";)/s
/^(.*?)((?:const|var) \S+=function\([^)]*\)\{"use strict";)/s
const INJECT_HELPERS_UMD_RE =
/^(.*)(\(function\([^)]*\)\{.+amd.+function\([^)]*\)\{"use strict";)/s
/^(.*?)(\(function\([^)]*\)\{.+amd.+function\([^)]*\)\{"use strict";)/s

let server: ViteDevServer

Expand Down

0 comments on commit dc06c5b

Please sign in to comment.