File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ function getWorkerPath(): string {
2020 const workerFile = isESM ? 'worker.mjs' : 'worker.cjs' ;
2121
2222 if ( isESM && import . meta?. url ) {
23- // ESM: same directory as current file
23+ // ESM: current file is bundled in dist/index.mjs, worker is in dist/utils/
2424 const currentDir = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
25- return path . resolve ( currentDir , workerFile ) ;
25+ return path . resolve ( currentDir , 'utils' , workerFile ) ;
2626 } else if ( ! isESM ) {
27- // CJS: same directory as current file
28- return path . resolve ( __dirname , workerFile ) ;
27+ // CJS: current file is bundled in dist/index.cjs, worker is in dist/utils/
28+ return path . resolve ( __dirname , 'utils' , workerFile ) ;
2929 } else {
3030 // Fallback: assume utils subdirectory in dist
3131 return path . resolve ( path . dirname ( process . argv [ 1 ] ?? '' ) , 'utils' , workerFile ) ;
You can’t perform that action at this time.
0 commit comments