File tree 3 files changed +3
-2
lines changed
3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,7 @@ async function doBuild(
426
426
exports : ssr ? 'named' : 'auto' ,
427
427
sourcemap : options . sourcemap ,
428
428
name : libOptions ? libOptions . name : undefined ,
429
+ generatedCode : 'es2015' ,
429
430
entryFileNames : ssr
430
431
? `[name].js`
431
432
: libOptions
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import { searchForWorkspaceRoot } from '..'
27
27
const debug = createDebugger ( 'vite:esbuild' )
28
28
29
29
const INJECT_HELPERS_IIFE_RE =
30
- / ( .* ) ( v a r [ ^ \s ] + = f u n c t i o n \( [ ^ ) ] * ?\) { " u s e s t r i c t " ; ) ( .* ) /
30
+ / ( .* ) ( (?: c o n s t | v a r ) [ ^ \s ] + = f u n c t i o n \( [ ^ ) ] * ?\) { " u s e s t r i c t " ; ) ( .* ) /
31
31
const INJECT_HELPERS_UMD_RE =
32
32
/ ( .* ) ( \( f u n c t i o n \( [ ^ ) ] * ?\) { .+ a m d .+ f u n c t i o n \( [ ^ ) ] * ?\) { " u s e s t r i c t " ; ) ( .* ) /
33
33
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ describe.runIf(isBuild)('build', () => {
31
31
'utf-8'
32
32
)
33
33
// esbuild helpers are injected inside of the IIFE wrapper
34
- expect ( code ) . toMatch ( / ^ v a r M y L i b = f u n c t i o n \( \) { " u s e s t r i c t " ; / )
34
+ expect ( code ) . toMatch ( / ^ c o n s t M y L i b = f u n c t i o n \( \) { " u s e s t r i c t " ; / )
35
35
} )
36
36
37
37
test ( 'Library mode does not include `preload`' , async ( ) => {
You can’t perform that action at this time.
0 commit comments