File tree Expand file tree Collapse file tree 2 files changed +40
-19
lines changed Expand file tree Collapse file tree 2 files changed +40
-19
lines changed Original file line number Diff line number Diff line change 1111 "module" : " dist/geoarrow.es.mjs" ,
1212 "main" : " dist/geoarrow.cjs" ,
1313 "exports" : {
14- "types" : " ./dist/index.d.ts" ,
15- "require" : " ./dist/geoarrow.cjs" ,
16- "default" : " ./dist/geoarrow.es.mjs"
14+ "." : {
15+ "types" : " ./dist/index.d.ts" ,
16+ "require" : " ./dist/geoarrow.cjs" ,
17+ "default" : " ./dist/geoarrow.es.mjs"
18+ },
19+ "./earcut.worker.js" : " ./dist/earcut.worker.js" ,
20+ "./earcut.worker.min.js" : " ./dist/earcut.worker.min.js"
1721 },
1822 "publishConfig" : {
1923 "access" : " public"
Original file line number Diff line number Diff line change 11// worker-build.mjs
22import esbuild from "esbuild" ;
33
4- esbuild . build ( {
5- entryPoints : [ "./src/worker-bundle/earcut.ts" ] ,
6- outfile : "dist/earcut-worker.js" ,
7- bundle : true ,
8- minify : false ,
9- target : [ "esnext" ] ,
10- format : "esm" ,
11- } ) ;
4+ // dist/earcut.worker.js was added to be easier for esbuild to consume, as it
5+ // allows loading as text via:
6+ // ```
7+ // loader: {
8+ // ".worker.js": "text",
9+ // ".worker.min.js": "text",
10+ // },
11+ // ```
12+ // We keep dist/earcut-worker.js for backwards compatibility.
13+ for ( const outfile of [ "dist/earcut-worker.js" , "dist/earcut.worker.js" ] ) {
14+ esbuild . build ( {
15+ entryPoints : [ "./src/worker-bundle/earcut.ts" ] ,
16+ outfile,
17+ bundle : true ,
18+ minify : false ,
19+ target : [ "esnext" ] ,
20+ format : "esm" ,
21+ } ) ;
22+ }
1223
13- esbuild . build ( {
14- entryPoints : [ "./src/worker-bundle/earcut.ts" ] ,
15- outfile : "dist/earcut-worker.min.js" ,
16- bundle : true ,
17- minify : true ,
18- target : [ "esnext" ] ,
19- format : "esm" ,
20- } ) ;
24+ // Likewise, earcut-worker.min.js is for backwards compatibility.
25+ for ( const outfile of [
26+ "dist/earcut-worker.min.js" ,
27+ "dist/earcut.worker.min.js" ,
28+ ] ) {
29+ esbuild . build ( {
30+ entryPoints : [ "./src/worker-bundle/earcut.ts" ] ,
31+ outfile,
32+ bundle : true ,
33+ minify : true ,
34+ target : [ "esnext" ] ,
35+ format : "esm" ,
36+ } ) ;
37+ }
You can’t perform that action at this time.
0 commit comments