forked from cawa-93/vite-electron-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
42 lines (38 loc) · 1 KB
/
vite.config.js
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
37
38
39
40
41
42
/* eslint-env node */
import {sveltekit} from '@sveltejs/kit/vite';
import {chrome} from './.electron-vendors.cache.json';
import {renderer} from 'unplugin-auto-expose';
import {join} from 'node:path';
import {injectAppVersion} from './version/inject-app-version-plugin.mjs';
const PACKAGE_ROOT = __dirname;
/**
* @type {import('vite').UserConfig}
* @see https://vitejs.dev/config/
*/
const config = {
mode: process.env.MODE,
build: {
sourcemap: true,
target: `chrome${chrome}`,
assetsDir: '.',
emptyOutDir: true,
reportCompressedSize: false,
},
test: {
environment: 'happy-dom',
include: ['./tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
/**
* The default timeout of 5000ms is sometimes not enough for playwright.
*/
testTimeout: 30_000,
hookTimeout: 30_000,
},
plugins: [
sveltekit(),
renderer.vite({
preloadEntry: join(PACKAGE_ROOT, 'packages/preload/src/index.ts'),
}),
injectAppVersion(),
],
};
export default config;