feat: added spa cache control

This commit is contained in:
=
2025-11-24 22:45:00 +05:30
parent e719de8710
commit 186c08ad27
5 changed files with 26 additions and 10 deletions

View File

@@ -23,6 +23,11 @@ const virtualRouteFileChangeReloadPlugin: PluginOption = {
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
const allowedHosts = env.VITE_ALLOWED_HOSTS?.split(",") ?? [];
const version = (
env.INFISICAL_PLATFORM_VERSION ||
env.VITE_INFISICAL_PLATFORM_VERSION ||
"0.0.1"
).replaceAll(".", "-");
return {
server: {
@@ -38,6 +43,15 @@ export default defineConfig(({ mode }) => {
// }
// }
},
build: {
rollupOptions: {
output: {
entryFileNames: `assets/[name]-${version}-[hash].js`,
chunkFileNames: `assets/[name]-${version}-[hash].js`,
assetFileNames: `assets/[name]-${version}-[hash].[ext]`
}
}
},
plugins: [
tsconfigPaths(),
nodePolyfills({