-
Notifications
You must be signed in to change notification settings - Fork 4
/
farm.config.ts
65 lines (61 loc) · 1.97 KB
/
farm.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
/*****************************************************************************
* AlgoHub: Cross-platform online judge client based on Tauri
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/
import { defineConfig } from "@farmfe/core";
import vue from "@vitejs/plugin-vue";
import worker from "@farmfe/plugin-worker";
import postcss from "@farmfe/js-plugin-postcss";
import Components from "unplugin-vue-components/vite";
import { PrimeVueResolver } from "@primevue/auto-import-resolver";
import path from "path";
const host = process.env.TAURI_DEV_HOST;
export default defineConfig({
plugins: [worker(), postcss()],
vitePlugins: [
vue(),
Components({
resolvers: [PrimeVueResolver()],
}),
],
clearScreen: false,
compilation: {
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
treeShaking: false,
define: {
"process.env.LOCAL": process.env.LOCAL ? true : false,
},
},
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
watchOptions: {
ignored: ["**/src-tauri/**"],
},
}
: undefined,
},
});