-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathvite.replay.config.ts
More file actions
35 lines (33 loc) · 1.02 KB
/
vite.replay.config.ts
File metadata and controls
35 lines (33 loc) · 1.02 KB
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
import { ConfigEnv, defineConfig, mergeConfig, UserConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import { getBuildConfig } from './vite.base.config'
export default defineConfig((env) => {
return mergeConfig(getBuildConfig(env as ConfigEnv<'build'>), {
plugins: [tsconfigPaths()],
mode: env.mode,
build: {
sourcemap: false,
target: 'esnext',
lib: {
entry: 'src/main/runner/shims/browser/replay.ts',
name: 'replay',
fileName: () => 'replay.js',
// The replay script needs to be an IIFE to avoid polluting the global scope
// of the recorded page.
formats: ['iife'],
},
outDir: 'resources',
rollupOptions: {
// By default, Vite will remove any top-level exports for entry files. This
// disabled that behavior.
external: [
'k6',
'k6/http',
'k6/browser',
'k6/execution',
'__USER_SCRIPT_PATH__',
],
},
},
} satisfies UserConfig)
})