File tree Expand file tree Collapse file tree 2 files changed +29
-4
lines changed
packages/react-router-node Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 16
16
"exports" : {
17
17
"." : {
18
18
"types" : " ./dist/index.d.ts" ,
19
- "default" : " ./dist/index.js"
19
+ "import" : " ./dist/index.mjs" ,
20
+ "require" : " ./dist/index.js"
20
21
},
21
22
"./install" : {
22
23
"types" : " ./dist/install.d.ts" ,
23
- "default" : " ./dist/install.js"
24
+ "import" : " ./dist/install.mjs" ,
25
+ "require" : " ./dist/install.js"
24
26
},
25
27
"./package.json" : " ./package.json"
26
28
},
Original file line number Diff line number Diff line change @@ -21,14 +21,17 @@ module.exports = function rollup() {
21
21
"react-router-node"
22
22
) ;
23
23
24
+ const input = [ `${ SOURCE_DIR } /index.ts` , `${ SOURCE_DIR } /install.ts` ] ;
25
+
24
26
return [
25
27
{
28
+ input,
26
29
external : ( id ) => isBareModuleId ( id ) ,
27
- input : [ `${ SOURCE_DIR } /index.ts` , `${ SOURCE_DIR } /install.ts` ] ,
28
30
output : {
29
31
banner : createBanner ( name , version ) ,
30
32
dir : OUTPUT_DIR ,
31
- format : "cjs" ,
33
+ entryFileNames : "[name].mjs" ,
34
+ format : "esm" ,
32
35
preserveModules : true ,
33
36
exports : "named" ,
34
37
} ,
@@ -50,5 +53,25 @@ module.exports = function rollup() {
50
53
} ) ,
51
54
] ,
52
55
} ,
56
+ {
57
+ input,
58
+ external : ( id ) => isBareModuleId ( id ) ,
59
+ output : {
60
+ banner : createBanner ( name , version ) ,
61
+ dir : OUTPUT_DIR ,
62
+ format : "cjs" ,
63
+ preserveModules : true ,
64
+ exports : "named" ,
65
+ } ,
66
+ plugins : [
67
+ babel ( {
68
+ babelHelpers : "bundled" ,
69
+ exclude : / n o d e _ m o d u l e s / ,
70
+ extensions : [ ".ts" , ".tsx" ] ,
71
+ ...remixBabelConfig ,
72
+ } ) ,
73
+ nodeResolve ( { extensions : [ ".ts" , ".tsx" ] } ) ,
74
+ ] ,
75
+ } ,
53
76
] ;
54
77
} ;
You can’t perform that action at this time.
0 commit comments