|
|
|
@ -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
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|