home-app/vite.config.js

26 lines
594 B
JavaScript
Raw Normal View History

2022-04-30 13:12:41 +00:00
import child_process from "child_process";
import legacy from "@vitejs/plugin-legacy";
2022-05-01 06:04:07 +00:00
import os from "os";
2022-04-30 03:45:14 +00:00
2022-04-29 14:52:00 +00:00
/**
* @type {import('vite').UserConfig}
*/
const config = {
2022-04-30 13:12:41 +00:00
base: "./",
define: {
2022-05-01 06:04:07 +00:00
__APP_VERSION__: `"${child_process
2022-04-30 13:12:41 +00:00
.execSync("git rev-parse --short HEAD")
.toString()
2022-05-01 06:04:07 +00:00
.replace("\n", "")}"`,
__APP_BUILD_TIME__: Math.floor(Date.now() / 1000),
__APP_BUILD_MACHINE__:`"${os.hostname}"`
2022-04-30 13:12:41 +00:00
},
plugins: [
legacy({
targets: ["ie >= 11"],
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
}),
],
};
export default config;