2022-03-28 10:57:56 +08:00
|
|
|
import { defineConfig } from 'vite'
|
2021-11-11 17:52:50 +08:00
|
|
|
import vue from '@vitejs/plugin-vue'
|
2022-03-28 10:57:56 +08:00
|
|
|
import resolve from 'vite-plugin-resolve'
|
2022-04-06 08:35:54 +08:00
|
|
|
import electron from 'vite-plugin-electron/renderer'
|
2022-01-27 08:49:40 +08:00
|
|
|
import pkg from '../../package.json'
|
2021-11-11 17:52:50 +08:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2021-11-27 10:51:32 +08:00
|
|
|
mode: process.env.NODE_ENV,
|
2022-01-27 08:49:40 +08:00
|
|
|
root: __dirname,
|
2022-01-16 09:09:21 +08:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
2022-03-28 10:57:56 +08:00
|
|
|
electron(),
|
|
|
|
resolve(
|
2022-01-21 10:14:56 +08:00
|
|
|
/**
|
2022-02-08 11:14:05 +08:00
|
|
|
* Here you can specify other modules
|
|
|
|
* 🚧 You have to make sure that your module is in `dependencies` and not in the` devDependencies`,
|
|
|
|
* which will ensure that the electron-builder can package it correctly
|
2022-01-21 10:14:56 +08:00
|
|
|
*/
|
2022-03-13 21:52:58 +08:00
|
|
|
{
|
2022-04-28 07:49:47 +08:00
|
|
|
// If you use electron-store, this will work - ESM format code snippets
|
2022-03-28 10:57:56 +08:00
|
|
|
'electron-store': 'const Store = require("electron-store"); export default Store;',
|
|
|
|
}
|
2022-01-21 10:14:56 +08:00
|
|
|
),
|
2022-01-16 09:09:21 +08:00
|
|
|
],
|
2021-11-11 17:52:50 +08:00
|
|
|
base: './',
|
|
|
|
build: {
|
|
|
|
outDir: '../../dist/renderer',
|
2022-04-15 07:52:22 +08:00
|
|
|
emptyOutDir: true,
|
|
|
|
sourcemap: true,
|
2021-11-11 17:52:50 +08:00
|
|
|
},
|
|
|
|
server: {
|
2022-03-15 08:34:23 +08:00
|
|
|
host: pkg.env.VITE_DEV_SERVER_HOST,
|
|
|
|
port: pkg.env.VITE_DEV_SERVER_PORT,
|
2021-11-11 17:52:50 +08:00
|
|
|
},
|
|
|
|
})
|