diff --git a/.changeset/witty-scissors-breathe.md b/.changeset/witty-scissors-breathe.md new file mode 100644 index 00000000..343cd712 --- /dev/null +++ b/.changeset/witty-scissors-breathe.md @@ -0,0 +1,9 @@ +--- +'yjs-react-supabase-text-collab': patch +'react-supabase-todolist': patch +'vue-supabase-todolist': patch +'example-electron': patch +'example-vite': patch +--- + +Updated the vite conf include rules for bson, buffer, rsocket and cross-fetch. diff --git a/demos/example-electron/vite.renderer.config.ts b/demos/example-electron/vite.renderer.config.ts index 3170037d..7b74d77f 100644 --- a/demos/example-electron/vite.renderer.config.ts +++ b/demos/example-electron/vite.renderer.config.ts @@ -29,7 +29,12 @@ export default defineConfig((env) => { '@powersync/web > event-iterator', '@powersync/web > js-logger', '@powersync/web > lodash/throttle', - '@powersync/web > can-ndjson-stream' + '@powersync/web > can-ndjson-stream', + '@powersync/web > bson', + '@powersync/web > buffer', + '@powersync/web > rsocket-core', + '@powersync/web > rsocket-websocket-client', + '@powersync/web > cross-fetch' ] }, plugins: [ diff --git a/demos/example-vite/vite.config.ts b/demos/example-vite/vite.config.ts index 6793b932..0e0e7ae7 100644 --- a/demos/example-vite/vite.config.ts +++ b/demos/example-vite/vite.config.ts @@ -29,7 +29,11 @@ export default defineConfig({ '@powersync/web > js-logger', '@powersync/web > lodash/throttle', '@powersync/web > can-ndjson-stream', - '@powersync/web > bson' + '@powersync/web > bson', + '@powersync/web > buffer', + '@powersync/web > rsocket-core', + '@powersync/web > rsocket-websocket-client', + '@powersync/web > cross-fetch' ] }, plugins: [wasm(), topLevelAwait()], diff --git a/demos/react-supabase-todolist/vite.config.mts b/demos/react-supabase-todolist/vite.config.mts index 73e88869..e2ddedee 100644 --- a/demos/react-supabase-todolist/vite.config.mts +++ b/demos/react-supabase-todolist/vite.config.mts @@ -36,7 +36,11 @@ export default defineConfig({ '@powersync/web > js-logger', '@powersync/web > lodash/throttle', '@powersync/web > can-ndjson-stream', - '@powersync/web > bson' + '@powersync/web > bson', + '@powersync/web > buffer', + '@powersync/web > rsocket-core', + '@powersync/web > rsocket-websocket-client', + '@powersync/web > cross-fetch' ] }, plugins: [ diff --git a/demos/vue-supabase-todolist/vite.config.ts b/demos/vue-supabase-todolist/vite.config.ts index 08821690..e61fec6d 100644 --- a/demos/vue-supabase-todolist/vite.config.ts +++ b/demos/vue-supabase-todolist/vite.config.ts @@ -6,7 +6,8 @@ import ViteFonts from 'unplugin-fonts/vite'; import Components from 'unplugin-vue-components/vite'; import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'; import { VitePWA } from 'vite-plugin-pwa'; - +import { createRequire } from 'node:module'; +const require = createRequire(import.meta.url); // Needed since the config file is also an ES module // Utilities import { fileURLToPath, URL } from 'node:url'; import { defineConfig } from 'vite'; @@ -69,9 +70,11 @@ export default defineConfig({ ], define: { 'process.env': {} }, resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) - }, + alias: [ + { find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }, + // https://jira.mongodb.org/browse/NODE-5773 + { find: 'bson', replacement: require.resolve('bson') } + ], extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue'] }, optimizeDeps: { @@ -82,7 +85,12 @@ export default defineConfig({ '@powersync/web > event-iterator', '@powersync/web > js-logger', '@powersync/web > lodash/throttle', - '@powersync/web > can-ndjson-stream' + '@powersync/web > can-ndjson-stream', + '@powersync/web > bson', + '@powersync/web > buffer', + '@powersync/web > rsocket-core', + '@powersync/web > rsocket-websocket-client', + '@powersync/web > cross-fetch' ] }, worker: { diff --git a/demos/yjs-react-supabase-text-collab/vite.config.mts b/demos/yjs-react-supabase-text-collab/vite.config.mts index dd9fe9ac..0ce75d3d 100644 --- a/demos/yjs-react-supabase-text-collab/vite.config.mts +++ b/demos/yjs-react-supabase-text-collab/vite.config.mts @@ -34,12 +34,15 @@ export default defineConfig({ // https://github.com/vitejs/vite/issues/11672#issuecomment-1415820673 exclude: ['@journeyapps/wa-sqlite', '@powersync/web'], include: [ - '@powersync/web > uuid', '@powersync/web > event-iterator', '@powersync/web > js-logger', '@powersync/web > lodash/throttle', '@powersync/web > can-ndjson-stream', - '@powersync/web > bson' + '@powersync/web > bson', + '@powersync/web > buffer', + '@powersync/web > rsocket-core', + '@powersync/web > rsocket-websocket-client', + '@powersync/web > cross-fetch' ] }, plugins: [