File tree Expand file tree Collapse file tree 5 files changed +42
-3
lines changed Expand file tree Collapse file tree 5 files changed +42
-3
lines changed Original file line number Diff line number Diff line change 22
22
" @module-federation/modern-js" ,
23
23
" @module-federation/retry-plugin" ,
24
24
" @module-federation/data-prefetch" ,
25
- " @module-federation/rsbuild-plugin"
25
+ " @module-federation/rsbuild-plugin" ,
26
+ " @module-federation/error-codes"
26
27
]
27
28
],
28
29
"ignorePatterns" : [" ^alpha|^beta" ],
Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/error-codes ' : patch
3
+ ---
4
+
5
+ fix(error-codes): esm should use .mjs ext
Original file line number Diff line number Diff line change 18
18
"access" : " public"
19
19
},
20
20
"main" : " ./dist/index.cjs.js" ,
21
- "module" : " ./dist/index.esm.js " ,
21
+ "module" : " ./dist/index.esm.mjs " ,
22
22
"types" : " ./dist/index.cjs.d.ts" ,
23
23
"exports" : {
24
24
"." : {
25
- "import" : " ./dist/index.esm.js " ,
25
+ "import" : " ./dist/index.esm.mjs " ,
26
26
"require" : " ./dist/index.cjs.js"
27
27
}
28
28
},
Original file line number Diff line number Diff line change 13
13
"outputPath" : " packages/error-codes/dist" ,
14
14
"main" : " packages/error-codes/src/index.ts" ,
15
15
"tsConfig" : " packages/error-codes/tsconfig.lib.json" ,
16
+ "rollupConfig" : " packages/error-codes/rollup.config.js" ,
16
17
"assets" : [],
17
18
"project" : " packages/error-codes/package.json" ,
18
19
"compiler" : " swc" ,
Original file line number Diff line number Diff line change
1
+ module . exports = ( rollupConfig , projectOptions ) => {
2
+ if ( Array . isArray ( rollupConfig . output ) ) {
3
+ rollupConfig . output = rollupConfig . output . map ( ( c ) => ( {
4
+ ...c ,
5
+ hoistTransitiveImports : false ,
6
+ entryFileNames :
7
+ c . format === 'esm'
8
+ ? c . entryFileNames . replace ( '.js' , '.mjs' )
9
+ : c . entryFileNames ,
10
+ chunkFileNames :
11
+ c . format === 'esm'
12
+ ? c . chunkFileNames . replace ( '.js' , '.mjs' )
13
+ : c . chunkFileNames ,
14
+ } ) ) ;
15
+ } else {
16
+ rollupConfig . output = {
17
+ ...rollupConfig . output ,
18
+
19
+ hoistTransitiveImports : false ,
20
+ entryFileNames :
21
+ rollupConfig . output . format === 'esm'
22
+ ? rollupConfig . output . entryFileNames . replace ( '.js' , '.mjs' )
23
+ : rollupConfig . output . entryFileNames ,
24
+ chunkFileNames :
25
+ rollupConfig . output . format === 'esm'
26
+ ? rollupConfig . output . chunkFileNames . replace ( '.js' , '.mjs' )
27
+ : rollupConfig . output . chunkFileNames ,
28
+ } ;
29
+ }
30
+
31
+ return rollupConfig ;
32
+ } ;
You can’t perform that action at this time.
0 commit comments