-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (31 loc) · 1020 Bytes
/
Copy pathvite.config.ts
File metadata and controls
32 lines (31 loc) · 1020 Bytes
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
import { defineConfig } from 'vite';
// Vite config for the rclnodejs Web Runtime TypeScript demo.
//
// `rclnodejs/web` is the public ESM entry exported from the
// `rclnodejs` npm package (see its package.json `exports` field), so
// Vite resolves it through `node_modules` with no alias required.
//
// The browser SDK uses a top-level `await import('ws')` to optionally
// pull in a Node WebSocket polyfill (no-op in real browsers). That
// requires an ES2022 build target both for the production bundle
// (`build.target`) and for esbuild's dev-mode dependency pre-bundling
// (`optimizeDeps.esbuildOptions.target`).
export default defineConfig({
server: {
// 8080 to match the JavaScript demo's static-file server, instead of
// Vite's default 5173 — keeps the two demos' README instructions in sync.
port: 8080,
},
esbuild: {
target: 'es2022',
},
optimizeDeps: {
esbuildOptions: {
target: 'es2022',
},
},
build: {
target: 'es2022',
sourcemap: true,
},
});