-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathvite.config.ts
47 lines (42 loc) · 1.15 KB
/
vite.config.ts
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
43
44
45
46
47
import { extension, isDEV } from './scripts/constants';
import { defineConfig, type UserConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { resolve } from 'path';
import UnoCSS from 'unocss/vite';
export const sharedConfig: UserConfig = {
define: {
__EXT_NAME__: JSON.stringify(extension.name),
__EXT_VER__: JSON.stringify(extension.version),
__EXT_MODE__:
parseInt(extension.version) < 1
? JSON.stringify('ALPHA')
: isDEV
? JSON.stringify('DEV')
: null
},
resolve: {
alias: {
'@': resolve('src'),
'@constants': resolve('src/lib/constants'),
'@components': resolve('src/lib/components'),
'@stores': resolve('src/lib/stores'),
'@utils': resolve('src/lib/utils'),
'@styles': resolve('src/styles')
}
}
};
// https://vitejs.dev/config/
export default defineConfig({
...sharedConfig,
plugins: [UnoCSS(), svelte()],
build: {
emptyOutDir: false,
rollupOptions: {
input: {
popup: 'src/popup/index.html',
options: 'src/options/index.html',
discarded: 'src/discarded/index.html'
}
}
}
});