Skip to content

Commit c59a222

Browse files
authored
fix(esbuild): inject esbuild helpers correctly for esbuild 0.25.9+ (#20940)
1 parent 3f337c5 commit c59a222

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const debug = createDebugger('vite:esbuild')
2929
// IIFE content looks like `var MyLib = function() {`.
3030
// Spaces are removed and parameters are mangled when minified
3131
const IIFE_BEGIN_RE =
32-
/(?:const|var)\s+\S+\s*=\s*function\([^()]*\)\s*\{\s*"use strict";/
32+
/(?:const|var)\s+\S+\s*=\s*\(?function\([^()]*\)\s*\{\s*"use strict";/
3333

3434
const validExtensionRE = /\.\w+$/
3535
const jsxExtensionsRE = /\.(?:j|t)sx\b/

0 commit comments

Comments
 (0)