mirror of
https://github.com/earthjasonlin/zzz-signal-search-export.git
synced 2024-11-22 21:30:22 +08:00
37 lines
791 B
JavaScript
37 lines
791 B
JavaScript
|
const { join } = require("path")
|
||
|
const vuePlugin = require("@vitejs/plugin-vue")
|
||
|
const { defineConfig } = require("vite")
|
||
|
|
||
|
function resolve(dir) {
|
||
|
return join(__dirname, '..', dir)
|
||
|
}
|
||
|
|
||
|
const root = resolve('src/renderer')
|
||
|
|
||
|
const config = defineConfig({
|
||
|
mode: process.env.NODE_ENV,
|
||
|
root,
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
'@renderer': root,
|
||
|
}
|
||
|
},
|
||
|
base: './',
|
||
|
build: {
|
||
|
outDir: process.env.BUILD_TARGET === 'web' ? resolve('dist/web') : resolve('dist/electron/renderer'),
|
||
|
emptyOutDir: true
|
||
|
},
|
||
|
server: {
|
||
|
port: Number(process.env.PORT),
|
||
|
},
|
||
|
plugins: [
|
||
|
vuePlugin({
|
||
|
script: {
|
||
|
refSugar: true
|
||
|
}
|
||
|
})
|
||
|
],
|
||
|
publicDir: resolve('static')
|
||
|
})
|
||
|
|
||
|
module.exports = config
|