@@ -6,7 +6,8 @@ import ViteFonts from 'unplugin-fonts/vite';
66import Components from 'unplugin-vue-components/vite' ;
77import Vuetify , { transformAssetUrls } from 'vite-plugin-vuetify' ;
88import { VitePWA } from 'vite-plugin-pwa' ;
9-
9+ import { createRequire } from 'node:module' ;
10+ const require = createRequire ( import . meta. url ) ; // Needed since the config file is also an ES module
1011// Utilities
1112import { fileURLToPath , URL } from 'node:url' ;
1213import { defineConfig } from 'vite' ;
@@ -69,9 +70,11 @@ export default defineConfig({
6970 ] ,
7071 define : { 'process.env' : { } } ,
7172 resolve : {
72- alias : {
73- '@' : fileURLToPath ( new URL ( './src' , import . meta. url ) )
74- } ,
73+ alias : [
74+ { find : '@' , replacement : fileURLToPath ( new URL ( './src' , import . meta. url ) ) } ,
75+ // https://jira.mongodb.org/browse/NODE-5773
76+ { find : 'bson' , replacement : require . resolve ( 'bson' ) }
77+ ] ,
7578 extensions : [ '.js' , '.json' , '.jsx' , '.mjs' , '.ts' , '.tsx' , '.vue' ]
7679 } ,
7780 optimizeDeps : {
@@ -82,7 +85,12 @@ export default defineConfig({
8285 '@powersync/web > event-iterator' ,
8386 '@powersync/web > js-logger' ,
8487 '@powersync/web > lodash/throttle' ,
85- '@powersync/web > can-ndjson-stream'
88+ '@powersync/web > can-ndjson-stream' ,
89+ '@powersync/web > bson' ,
90+ '@powersync/web > buffer' ,
91+ '@powersync/web > rsocket-core' ,
92+ '@powersync/web > rsocket-websocket-client' ,
93+ '@powersync/web > cross-fetch'
8694 ]
8795 } ,
8896 worker : {
0 commit comments