mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 15:20:09 +01:00
Thinking of adding Electron.js
This commit is contained in:
parent
a352a94d8a
commit
fd3fc66bfc
2
src/static/app/.gitignore
vendored
2
src/static/app/.gitignore
vendored
@ -28,4 +28,4 @@ coverage
|
|||||||
|
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
.vite/*
|
.vite/*
|
||||||
.electron/*
|
electron
|
6
src/static/app/dist/assets/index.css
vendored
6
src/static/app/dist/assets/index.css
vendored
File diff suppressed because one or more lines are too long
56
src/static/app/dist/assets/index.js
vendored
56
src/static/app/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "app",
|
"name": "app",
|
||||||
"version": "0.0.0",
|
"version": "4.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
"build electron": "vite build --mode electron",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -5,27 +5,62 @@ import {proxy} from "./proxy.js";
|
|||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig(({mode}) => {
|
||||||
base: "/static/app/dist",
|
if (mode === 'production'){
|
||||||
plugins: [
|
return {
|
||||||
vue(),
|
base: "/static/app/dist",
|
||||||
],
|
plugins: [
|
||||||
resolve: {
|
vue(),
|
||||||
alias: {
|
],
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
server:{
|
||||||
|
proxy: {
|
||||||
|
'/api': proxy
|
||||||
|
}
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
outDir: 'dist',
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
entryFileNames: `assets/[name].js`,
|
||||||
|
chunkFileNames: `assets/[name].js`,
|
||||||
|
assetFileNames: `assets/[name].[ext]`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
server:{
|
|
||||||
proxy: {
|
if (mode === 'electron'){
|
||||||
'/api': proxy
|
return {
|
||||||
}
|
emptyOutDir: false,
|
||||||
},
|
base: './',
|
||||||
build: {
|
plugins: [
|
||||||
rollupOptions: {
|
vue(),
|
||||||
output: {
|
],
|
||||||
entryFileNames: `assets/[name].js`,
|
resolve: {
|
||||||
chunkFileNames: `assets/[name].js`,
|
alias: {
|
||||||
assetFileNames: `assets/[name].[ext]`
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
server:{
|
||||||
|
proxy: {
|
||||||
|
'/api': proxy
|
||||||
|
}
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
outDir: 'electron',
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
entryFileNames: `assets/[name].js`,
|
||||||
|
chunkFileNames: `assets/[name].js`,
|
||||||
|
assetFileNames: `assets/[name].[ext]`
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user