diff --git a/index.html b/index.html index 9577809..c1afad7 100644 --- a/index.html +++ b/index.html @@ -9,5 +9,6 @@
+

BUILD_DATE: %BUILD_DATE%

diff --git a/vite.config.js b/vite.config.js index a5b5f14..8659be5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,9 +2,21 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import WindiCSS from 'vite-plugin-windicss' +const buildDatePlugin = () => { + return { + transformIndexHtml(html) { + const dataString = new Date().toISOString() + return html.replace( + /%BUILD_DATE%/, + `${dataString}`, + ) + }, + } +} + // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react(), WindiCSS()], + plugins: [react(), WindiCSS(), buildDatePlugin()], server: { host: "0.0.0.0", }, @@ -30,5 +42,8 @@ export default defineConfig({ // } // } // } + }, + terserOptions: { + maxWorkers: 4 } })