-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
95 lines (93 loc) · 3.17 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
// import UnoCSS from 'unocss/vite';
import path from 'path';
import AutoImport from 'unplugin-auto-import/vite';
import ViteYaml from '@modyfi/vite-plugin-yaml';
// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
// UnoCSS(),
svelte(),
AutoImport({
imports: [
'svelte',
'svelte/store',
'svelte/transition',
{
axios: [
['default', 'axios'], // import { default as axios } from 'axios',
],
'lodash-es': [
['range', 'linspace'],
'isEmpty',
'isArray',
'isObject',
'isString',
'isNumber',
'isInteger',
'isBoolean',
],
'@zmotivat0r/o0': ['oO'],
'$lib/utils/toast': ['toast', 'Toaster'],
'$lib/utils/logger': ['logger'],
'svelte-persisted-store': [['persisted', 'localWritable']],
'$lib/pyserver/computePy': [['default', 'computePy']],
'$lib/utils/initialise': ['getID', 'sleep'],
'$lib/utils/index': [
// 'localWritable',
'typeSafeObjectKeys',
'safeJsonParse',
'safeJsonStringify',
'readJSON',
'writeJSON',
'fs',
'path',
'dialog',
'shell',
'os',
'invoke',
'platform',
'arch',
'getVersion',
'getTauriVersion',
'checkUpdate',
'installUpdate',
'relaunch',
'listen',
],
},
],
dts: './src/auto-imports.d.ts',
}),
ViteYaml(),
],
resolve: {
alias: {
'plotly.js-dist': 'plotly.js-dist-min',
$lib: path.resolve('./src/lib/'),
$pages: path.resolve('./src/pages/'),
$utils: path.resolve('./src/utils/'),
$settings: path.resolve('./src/pages/settings/'),
$components: path.resolve('./src/lib/components/'),
},
},
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
},
envPrefix: ['VITE_'],
build: {
chunkSizeWarningLimit: 2000,
// rollupOptions: {
// output: {
// manualChunks: {},
// },
// },
},
}));