76 lines
1.8 KiB
JavaScript
76 lines
1.8 KiB
JavaScript
import { fileURLToPath, URL } from "url";
|
|
|
|
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { VitePWA } from "vite-plugin-pwa";
|
|
import * as child from "child_process";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
define: {
|
|
GITVERSION: JSON.stringify(
|
|
child.execSync("git rev-parse --short HEAD").toString(),
|
|
),
|
|
GITURL: JSON.stringify(
|
|
child.execSync("git config --get remote.origin.url").toString(),
|
|
),
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
VitePWA({
|
|
includeAssets: [
|
|
"favicon.svg",
|
|
"icon.png",
|
|
"fonts/SourceSansPro-ExtraLight.ttf",
|
|
"fonts/SourceSansPro-Light.ttf",
|
|
"fonts/SourceSansPro-Regular.ttf",
|
|
],
|
|
registerType: "autoUpdate",
|
|
manifest: {
|
|
name: "Timetable V2",
|
|
short_name: "Timetable",
|
|
description: "Timetable and Substitution plan viewer",
|
|
theme_color: "#212121",
|
|
background_color: "#353535",
|
|
display: "standalone",
|
|
icons: [
|
|
{
|
|
src: "/favicon.svg",
|
|
sizes: "512x512",
|
|
type: "image/svg+xml",
|
|
},
|
|
{
|
|
src: "/icon.png",
|
|
sizes: "512x512",
|
|
type: "image/png",
|
|
},
|
|
{
|
|
src: "/icon.png",
|
|
sizes: "512x512",
|
|
type: "image/png",
|
|
purpose: "any maskable",
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
port: 3001,
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://localhost:3000",
|
|
changeOrigin: true,
|
|
},
|
|
"/auth": {
|
|
target: "http://localhost:3000",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|