-
Notifications
You must be signed in to change notification settings - Fork 681
/
vite.config.ts
41 lines (39 loc) · 1.3 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
import vue from '@vitejs/plugin-vue';
import path from 'path';
import { defineConfig } from 'vite';
/**
* This vite config file is used only for dev mode, i.e.
* to create a serve build modules of the source code
* which will be rendered by electron.
*
* For building the project, vite is used programmatically
* see build/scripts/build.mjs for this.
*/
export default () => {
let port = 6969;
let host = '0.0.0.0';
if (process.env.VITE_PORT && process.env.VITE_HOST) {
port = Number(process.env.VITE_PORT);
host = process.env.VITE_HOST;
}
return defineConfig({
server: { host, port, strictPort: true },
root: path.resolve(__dirname, './src'),
plugins: [vue()],
resolve: {
alias: {
vue: 'vue/dist/vue.esm-bundler.js',
fyo: path.resolve(__dirname, './fyo'),
src: path.resolve(__dirname, './src'),
schemas: path.resolve(__dirname, './schemas'),
backend: path.resolve(__dirname, './backend'),
models: path.resolve(__dirname, './models'),
utils: path.resolve(__dirname, './utils'),
regional: path.resolve(__dirname, './regional'),
reports: path.resolve(__dirname, './reports'),
dummy: path.resolve(__dirname, './dummy'),
fixtures: path.resolve(__dirname, './fixtures'),
},
},
});
};