This commit is contained in:
2022-05-01 14:04:07 +08:00
parent 42c71b44c6
commit b794f77721
7 changed files with 44 additions and 39 deletions

View File

@ -1,5 +1,6 @@
import child_process from "child_process";
import legacy from "@vitejs/plugin-legacy";
import os from "os";
/**
* @type {import('vite').UserConfig}
@ -7,11 +8,12 @@ import legacy from "@vitejs/plugin-legacy";
const config = {
base: "./",
define: {
__APP_VERSION: child_process
__APP_VERSION__: `"${child_process
.execSync("git rev-parse --short HEAD")
.toString()
.replace("\n", ""),
__APP_BUILD_TIME: Math.floor(Date.now() / 1000),
.replace("\n", "")}"`,
__APP_BUILD_TIME__: Math.floor(Date.now() / 1000),
__APP_BUILD_MACHINE__:`"${os.hostname}"`
},
plugins: [
legacy({