feat: added spa cache control

This commit is contained in:
=
2025-11-24 22:45:49 +05:30
parent e719de8710
commit 186c08ad27
5 changed files with 26 additions and 10 deletions
-4
View File
@@ -1,9 +1,5 @@
@import "tailwindcss";
@import "@fontsource/inter/400.css" layer(base);
@import "@fontsource/inter/500.css" layer(base);
@import "@fontsource/inter/700.css" layer(base);
@source not "../public";
/*
+2
View File
@@ -12,6 +12,8 @@ import { NotFoundPage } from "./pages/public/NotFoundPage/NotFoundPage";
// Import the generated route tree
import { routeTree } from "./routeTree.gen";
import "@fontsource/inter/400.css";
import "@fontsource/inter/500.css";
import "@xyflow/react/dist/style.css";
import "nprogress/nprogress.css";
import "react-toastify/dist/ReactToastify.css";
+14
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({