Make PowerSync works for Expo Web!
The dist
dir of the repo ships the built worker scripts for @powersync/[email protected]
and @journeyapps/[email protected]
.
If you need to use other versions, you need to change the version in package.json
, and run:
pnpm install
pnpm build
export PROJECT_ROOT=/path/to/your/projects
cp ./dist "$PROJECT_ROOT/public/lib/powersync/worker"
@powersync/web
moduleYou need to patch the following files of @powersync/web
module to make it use our copied worker files
lib/src/db/sync/SharedWebStreamingSyncImplementation.js
lib/src/worker/db/open-worker-database.js
Change the new URL('xxx', import.meta.url)
in these files to '/public/lib/powersync/worker/xxx'
. See @[email protected]
file in the repo for reference.