@@ -6,7 +6,8 @@ import ViteFonts from 'unplugin-fonts/vite';
6
6
import Components from 'unplugin-vue-components/vite' ;
7
7
import Vuetify , { transformAssetUrls } from 'vite-plugin-vuetify' ;
8
8
import { 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
10
11
// Utilities
11
12
import { fileURLToPath , URL } from 'node:url' ;
12
13
import { defineConfig } from 'vite' ;
@@ -69,9 +70,11 @@ export default defineConfig({
69
70
] ,
70
71
define : { 'process.env' : { } } ,
71
72
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
+ ] ,
75
78
extensions : [ '.js' , '.json' , '.jsx' , '.mjs' , '.ts' , '.tsx' , '.vue' ]
76
79
} ,
77
80
optimizeDeps : {
@@ -82,7 +85,12 @@ export default defineConfig({
82
85
'@powersync/web > event-iterator' ,
83
86
'@powersync/web > js-logger' ,
84
87
'@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'
86
94
]
87
95
} ,
88
96
worker : {
0 commit comments