This repository was archived by the owner on Apr 21, 2025. It is now read-only.
File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ export const build = async (
72
72
logRollupConfig ( pkg , rollupConfig )
73
73
74
74
await runInParallel ( pkg . folderExports , folder => {
75
- const { 1 : distDir = folder } = folder . match ( / ^ ( .* [ ^ * / ] ) [ * / ] * $ / ) || [ ]
75
+ const { 1 : distDir = folder , 3 : ext } =
76
+ folder . match ( / ^ ( [ ^ * ] + [ ^ * / ] ) [ * / ] + ( \. ( [ a - z ] + ) ) ? $ / ) || [ ]
76
77
const sourceFolder = pkg . resolveEntrypointFolder ( distDir )
77
78
if ( ! sourceFolder ) return
78
79
@@ -84,6 +85,9 @@ export const build = async (
84
85
srcDir,
85
86
distDir : distDir . slice ( 2 ) ,
86
87
rootDir : pkg . options . rootDir ,
88
+ ext : [ 'mjs' , 'ts' , 'js' ] . includes ( ext )
89
+ ? ( ext as 'mjs' | 'ts' | 'js' )
90
+ : undefined ,
87
91
...pkg . options . mkdist ,
88
92
} )
89
93
} )
Original file line number Diff line number Diff line change @@ -423,7 +423,9 @@ export class Package {
423
423
`./${ this . pkg . main } ` ,
424
424
`./${ this . pkg . module } ` ,
425
425
`./${ this . pkg . browser } ` ,
426
- ] . includes ( item ) && ! / [ . / * ] $ / . test ( item )
426
+ ] . includes ( item ) &&
427
+ ! item . endsWith ( '/' ) &&
428
+ ! item . includes ( '*' )
427
429
428
430
if ( ! exports ) return [ ]
429
431
if ( typeof exports === 'string' ) return [ exports ] . filter ( filterExports )
@@ -435,7 +437,7 @@ export class Package {
435
437
get folderExports ( ) : string [ ] {
436
438
const { exports } = this . pkg
437
439
438
- const filterExports = ( item : string ) => / [ a - z ] \/ \* $ / . test ( item )
440
+ const filterExports = ( item : string ) => / [ a - z ] \/ \* ( \. [ a - z ] * ) ? $ / . test ( item )
439
441
440
442
if ( ! exports ) return [ ]
441
443
if ( typeof exports === 'string' ) return [ exports ] . filter ( filterExports )
You can’t perform that action at this time.
0 commit comments