|
|
|
|
@ -5,8 +5,10 @@ import { VitePWA } from 'vite-plugin-pwa';
|
|
|
|
|
import packageJson from './package.json';
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import svgr from "vite-plugin-svgr";
|
|
|
|
|
import { execSync } from 'child_process';
|
|
|
|
|
|
|
|
|
|
const today = new dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
|
const gitHead = execSync('git rev-parse --short HEAD').toString().trim()
|
|
|
|
|
|
|
|
|
|
const buildDatePlugin = () => {
|
|
|
|
|
return {
|
|
|
|
|
@ -159,6 +161,7 @@ export default defineConfig({
|
|
|
|
|
define: {
|
|
|
|
|
__BUILD_DATE__: JSON.stringify(`${today}`),
|
|
|
|
|
__BUILD_VERSION__: JSON.stringify(`${packageJson.version}`),
|
|
|
|
|
__GIT_HEAD__: JSON.stringify(`${gitHead}`),
|
|
|
|
|
},
|
|
|
|
|
plugins: [ svgr(), react(), WindiCSS(), buildDatePlugin(), VitePWA(manifestForPWAPlugIn), ],
|
|
|
|
|
server: {
|
|
|
|
|
|