2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +00:00
books/vite.config.ts

42 lines
1.3 KiB
TypeScript
Raw Normal View History

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.
2023-06-27 07:40:04 +00:00
*
* 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'),
},
},
});
};