@@ -25,7 +25,6 @@ async function main() {
25
25
platform : "neutral" ,
26
26
format : "esm" ,
27
27
...sharedOptions ,
28
- sourcemap : false ,
29
28
} ) ;
30
29
31
30
// Remove the types file from the dist-src folder
@@ -37,30 +36,6 @@ async function main() {
37
36
await rm ( typeFile ) ;
38
37
}
39
38
40
- const entryPoints = [ "./pkg/dist-src/index.js" ] ;
41
-
42
- await Promise . all ( [
43
- // Build the a CJS Node.js bundle
44
- esbuild . build ( {
45
- entryPoints,
46
- outdir : "pkg/dist-node" ,
47
- bundle : true ,
48
- platform : "node" ,
49
- target : "node14" ,
50
- format : "cjs" ,
51
- ...sharedOptions ,
52
- } ) ,
53
- // Build an ESM browser bundle
54
- esbuild . build ( {
55
- entryPoints,
56
- outdir : "pkg/dist-web" ,
57
- bundle : true ,
58
- platform : "browser" ,
59
- format : "esm" ,
60
- ...sharedOptions ,
61
- } ) ,
62
- ] ) ;
63
-
64
39
// Copy the README, LICENSE to the pkg folder
65
40
await copyFile ( "LICENSE" , "pkg/LICENSE" ) ;
66
41
await copyFile ( "README.md" , "pkg/README.md" ) ;
@@ -77,11 +52,15 @@ async function main() {
77
52
JSON . stringify (
78
53
{
79
54
...pkg ,
80
- files : [ "dist-*/**" , "bin/**" ] ,
81
- main : "dist-node/index.js" ,
82
- module : "dist-web/index.js" ,
55
+ files : [ "dist-*/**" ] ,
56
+ main : "dist-src/index.js" ,
83
57
types : "dist-types/index.d.ts" ,
84
- source : "dist-src/index.js" ,
58
+ exports : {
59
+ "." : {
60
+ types : "./dist-types/index.d.ts" ,
61
+ import : "./dist-src/index.js" ,
62
+ }
63
+ } ,
85
64
sideEffects : false ,
86
65
} ,
87
66
null ,
0 commit comments