@@ -431,18 +431,18 @@ testMany(
431
431
432
432
testMany (
433
433
'Can bundle ESM functions and transpile them to CJS when the Node version is <14' ,
434
- [ 'bundler_nft' ] ,
434
+ [ 'bundler_default' , 'bundler_esbuild' , ' bundler_nft'] ,
435
435
async ( options , t ) => {
436
436
const length = 4
437
437
const fixtureName = 'local-require-esm'
438
438
const opts = merge ( options , {
439
- basePath : ` ${ FIXTURES_DIR } / ${ fixtureName } ` ,
439
+ basePath : join ( FIXTURES_DIR , fixtureName ) ,
440
440
config : {
441
441
'*' : {
442
442
nodeVersion : 'nodejs12.x' ,
443
443
} ,
444
444
} ,
445
- featureFlags : { defaultEsModulesToEsbuild : false } ,
445
+ featureFlags : { zisi_detect_esm : true , zisi_pure_esm : false } ,
446
446
} )
447
447
const { files, tmpDir } = await zipFixture ( t , fixtureName , {
448
448
length,
@@ -485,19 +485,19 @@ testMany(
485
485
486
486
testMany (
487
487
'Can bundle ESM functions and transpile them to CJS when the Node version is <14 and `archiveType` is `none`' ,
488
- [ 'bundler_esbuild' , 'bundler_nft' ] ,
488
+ [ 'bundler_default' , ' bundler_esbuild', 'bundler_nft' ] ,
489
489
async ( options , t ) => {
490
490
const length = 4
491
491
const fixtureName = 'local-require-esm'
492
492
const opts = merge ( options , {
493
493
archiveFormat : 'none' ,
494
- basePath : ` ${ FIXTURES_DIR } / ${ fixtureName } ` ,
494
+ basePath : join ( FIXTURES_DIR , fixtureName ) ,
495
495
config : {
496
496
'*' : {
497
497
nodeVersion : 'nodejs12.x' ,
498
498
} ,
499
499
} ,
500
- featureFlags : { defaultEsModulesToEsbuild : false } ,
500
+ featureFlags : { zisi_detect_esm : true , zisi_pure_esm : false } ,
501
501
} )
502
502
const { tmpDir } = await zipFixture ( t , fixtureName , {
503
503
length,
@@ -538,11 +538,14 @@ testMany(
538
538
539
539
testMany (
540
540
'Can bundle CJS functions that import ESM files with an `import()` expression' ,
541
- [ 'bundler_esbuild' , 'bundler_nft' ] ,
541
+ [ 'bundler_default' , ' bundler_esbuild', 'bundler_nft' ] ,
542
542
async ( options , t ) => {
543
543
const fixtureName = 'node-cjs-importing-mjs'
544
+ const opts = merge ( options , {
545
+ featureFlags : { zisi_detect_esm : true } ,
546
+ } )
544
547
const { files, tmpDir } = await zipFixture ( t , fixtureName , {
545
- opts : options ,
548
+ opts,
546
549
} )
547
550
548
551
await unzipFiles ( files )
@@ -561,13 +564,13 @@ testMany(
561
564
562
565
testMany (
563
566
'Can bundle native ESM functions when the Node version is >=14 and the `zisi_pure_esm` flag is on' ,
564
- [ 'bundler_nft' ] ,
567
+ [ 'bundler_default' , ' bundler_nft' , 'bundler_esbuild '] ,
565
568
async ( options , t ) => {
566
569
const length = 2
567
570
const fixtureName = 'node-esm'
568
571
const opts = merge ( options , {
569
- basePath : ` ${ FIXTURES_DIR } / ${ fixtureName } ` ,
570
- featureFlags : { zisi_pure_esm : true } ,
572
+ basePath : join ( FIXTURES_DIR , fixtureName ) ,
573
+ featureFlags : { zisi_detect_esm : true , zisi_pure_esm : true } ,
571
574
} )
572
575
const { files, tmpDir } = await zipFixture ( t , fixtureName , {
573
576
length,
@@ -593,12 +596,13 @@ testMany(
593
596
594
597
testMany (
595
598
'Can bundle ESM functions and transpile them to CJS when the Node version is >=14 and the `zisi_pure_esm` flag is off' ,
596
- [ 'bundler_nft' ] ,
599
+ [ 'bundler_default' , 'bundler_esbuild' , ' bundler_nft'] ,
597
600
async ( options , t ) => {
598
601
const length = 2
599
602
const fixtureName = 'node-esm'
600
603
const opts = merge ( options , {
601
- basePath : `${ FIXTURES_DIR } /${ fixtureName } ` ,
604
+ basePath : join ( FIXTURES_DIR , fixtureName ) ,
605
+ featureFlags : { zisi_detect_esm : true } ,
602
606
} )
603
607
const { files, tmpDir } = await zipFixture ( t , fixtureName , {
604
608
length,
1 commit comments
github-actions[bot] commentedon Feb 15, 2022
⏱ Benchmark results
largeDepsEsbuild: 7.1s
largeDepsZisi: 57.1s