Revert "Add no-cache headers to index.html via custom Vite plugin"

This reverts commit 93ce53394fe9d0f479870278b3e02ef9338d92e5.
This commit is contained in:
yangdx 2025-07-26 08:28:05 +08:00
parent b3c2987006
commit 10b55dbdc7

View File

@ -4,21 +4,9 @@ import { webuiPrefix } from '@/lib/constants'
import react from '@vitejs/plugin-react-swc'
import tailwindcss from '@tailwindcss/vite'
// A custom Vite plugin to add cache-control headers to index.html
const noCachePlugin = () => ({
name: 'no-cache',
transformIndexHtml(html: string) {
const cacheControlMeta = `
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />`;
return html.replace('</head>', `${cacheControlMeta}\n</head>`);
},
});
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss(), noCachePlugin()],
plugins: [react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')