I am using web worker in my application and I use vite for build.
I have a following code in my app:
new Worker(new URL("./worker.js", import.meta.url), {
type: "module",
});
The build structure is like:
I am building the app and use it in another app using npm dependency. I am getting a path issue. The app looks for public path, for example on my local dev env, it is like this: http://localhost:5174/public/assets/worker-lPYB70QI.js?worker_file&type=module.
I am expecting something like this:
http://localhost:5174/node_modules/BUILD_NAME/dist/assets/worker-lPYB70QI.js?worker_file&type=module