-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
62 lines (58 loc) · 1.83 KB
/
vite.config.ts
File metadata and controls
62 lines (58 loc) · 1.83 KB
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
import react from '@vitejs/plugin-react';
import Inspect from 'vite-plugin-inspect';
import basicSsl from '@vitejs/plugin-basic-ssl';
import { splitVendorChunkPlugin, defineConfig } from 'vite';
import { setDefaultResultOrder } from 'node:dns';
import { resolve } from 'node:path';
import { readFileSync } from 'node:fs';
setDefaultResultOrder('verbatim');
// https://vitejs.dev/config/
/** @type {import('vite').UserConfig} */
export default defineConfig({
server: {
host: 'kronos.dev',
port: 443,
https: {
key: readFileSync('secure/kronos.dev-key.pem', 'utf8'),
cert: readFileSync('secure/kronos.dev.pem', 'utf8'),
},
proxy: {
'/api': {
target: 'https://kronos.dev:3443/',
changeOrigin: !0,
secure: !1,
},
},
},
build: {
watch: { include: 'src/**/*.{ts,tsx,html,css}' },
manifest: !0,
assetsDir: 'public',
target: ['es2021', 'chrome100', 'safari13'],
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
sourcemap: !!process.env.TAURI_DEBUG,
},
plugins: [
Inspect(),
// compress({
// verbose: !0,
// extensions: ['js', 'css', 'ts', 'tsx', 'html'],
// }),
react({ include: 'src/**/*.{ts,tsx,html,css}' }),
// reactPlugin({
// injectReact: !1,
// removeDevtoolsInProd: !0,
// }),
splitVendorChunkPlugin(),
basicSsl(),
],
resolve: {
alias: {
'@Components': resolve(__dirname, './src/components/'), // "@Components/*": ["components/*"]
'@Template': resolve(__dirname, './src/components/template/'), // "@Template/*": ["components/template/*"]
'@SVG': resolve(__dirname, './src/assets/svg/'), // "@SVG/*": ["assets/svg/*"]
'@Types': resolve(__dirname, './src/types/'), // "@Types/*": ["types/*"]
'@Local': resolve(__dirname, './src/'), // "@Local/*": ["*"]
},
},
});