Closed muzhi1991 closed 1 month ago
./worker
is the path written in the SQLocal code. Your bundler should parse this import and do the proper modifications to bundle it for you. It looks like your bundler is not configured correctly to do this if it is outputting the ./worker
path with no modification, and that is why you are getting the "Invalid URL" error.
For example, in a project that I bundle using Vite, it detects the import and rewrites the path to ../workers/worker-BC_MBDWR.js
. Any standard JavaScript bundling tool should be able to handle this for you.
When I use this project as a dependency for my plugin development (a plugin for Electron app), I need to package all the files into a
main.js
file. This is when calling this library will prompt ErrorIt seems that a js file is referenced by the URL to start the worker. How to support this situation?
How to deal with this situation? Can we add support for bundle into one file?