mirror of
https://github.com/containrrr/watchtower.git
synced 2026-01-30 04:35:15 +01:00
Use Vite build tool
This commit is contained in:
parent
57b4862a5b
commit
5645cd23fe
40 changed files with 3513 additions and 2715 deletions
20
web/vite.config.ts
Normal file
20
web/vite.config.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { defineConfig, loadEnv } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
const htmlPlugin = (mode: string) => {
|
||||
const env = loadEnv(mode, ".");
|
||||
|
||||
return {
|
||||
name: "html-transform",
|
||||
transformIndexHtml(html: string) {
|
||||
return html.replace(/%(.*?)%/g, function (match, p1) {
|
||||
return env[p1];
|
||||
});
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => ({
|
||||
plugins: [react(), htmlPlugin(mode)]
|
||||
}));
|
||||
Loading…
Add table
Add a link
Reference in a new issue