-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
36 lines (35 loc) · 1.06 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import wasm from 'vite-plugin-wasm';
import topLevelAwait from 'vite-plugin-top-level-await';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
root: 'src',
build: {
outDir: '../dist',
rollupOptions: {
input: 'src/index.html'
},
emptyOutDir: true
},
envDir: '..', // Use this dir for env vars, not 'src'.
optimizeDeps: {
// Don't optimize these packages as they contain web workers and WASM files.
// https://github.com/vitejs/vite/issues/11672#issuecomment-1415820673
exclude: ['@journeyapps/wa-sqlite', '@powersync/web'],
include: [
'@powersync/web > event-iterator',
'@powersync/web > js-logger',
'@powersync/web > lodash/throttle',
'@powersync/web > can-ndjson-stream',
'@powersync/web > buffer',
'@powersync/web > rsocket-core',
'@powersync/web > rsocket-websocket-client',
'@powersync/web > cross-fetch'
]
},
plugins: [wasm(), topLevelAwait()],
worker: {
format: 'es',
plugins: () => [wasm(), topLevelAwait()]
}
});