Skip to content

Commit c89f677

Browse files
authoredJul 21, 2023
fix: constrain inject helpers for iife (#13909)
1 parent da389cc commit c89f677

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
@@ -29,9 +29,9 @@ import { searchForWorkspaceRoot } from '../server/searchRoot'
2929
const debug = createDebugger('vite:esbuild')
3030

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.