Skip to content

Commit

Permalink
PSP-8198 Vite fix (#3945)
Browse files Browse the repository at this point in the history
* PSP-8198: exclude JSON files from vite gzip compression

* Load tenant.json from root URL
  • Loading branch information
asanchezr authored Apr 10, 2024
1 parent 95a8fb6 commit 3825504
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/frontend/src/tenants/tenant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const TenantProvider: React.FC<React.PropsWithChildren<unknown>> = props
}
} else {
// Fetch the configuration file generated for the environment.
const r = await axios.get<ITenantConfig>('tenants/tenant.json');
const r = await axios.get<ITenantConfig>('/tenants/tenant.json');
const fileTenantConfig = await r.data;
setTenant({ ...defaultTenant, ...fileTenantConfig });
}
Expand Down
4 changes: 3 additions & 1 deletion source/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export default defineConfig({
svgr({
include: '**/*.svg?react',
}),
viteCompression(),
viteCompression({
filter: /\.(js|mjs|css|html)$/i,
}),
],
});

0 comments on commit 3825504

Please sign in to comment.