-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathvite.script.config.ts
More file actions
33 lines (31 loc) · 915 Bytes
/
vite.script.config.ts
File metadata and controls
33 lines (31 loc) · 915 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
33
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,
minify: false,
target: 'esnext',
lib: {
entry: 'src/main/runner/entrypoint.ts',
fileName: () => 'entrypoint.js',
formats: ['es'],
},
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)
})