-
-
Notifications
You must be signed in to change notification settings - Fork 195
/
vite.config.mts
37 lines (35 loc) · 930 Bytes
/
vite.config.mts
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
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { lingui } from '@lingui/vite-plugin';
import { chrome } from './scripts/electron-vendors.mjs';
import pkg from './package.json';
const currentFolderPath = fileURLToPath(new URL('.', import.meta.url));
const srcFolderPath = path.resolve(currentFolderPath, 'src');
const rendererFolderPath = path.resolve(srcFolderPath, 'ui');
export default defineConfig({
root: process.env.VITEST ? '' : rendererFolderPath,
resolve: {
alias: {
csdm: srcFolderPath,
},
},
base: '',
build: {
outDir: path.resolve(currentFolderPath, 'out'),
target: `chrome${chrome}`,
sourcemap: true,
},
define: {
APP_VERSION: `"${pkg.version}"`,
},
plugins: [
react({
babel: {
plugins: ['macros'],
},
}),
lingui(),
],
});