️ perf(route): enhancements

This commit is contained in:
eshanized
2024-12-27 23:23:38 +05:30
parent 953a88891b
commit c611296ef1
3 changed files with 23 additions and 6 deletions

View File

@@ -40,6 +40,7 @@
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.2",
"vite": "^5.4.11"
"vite": "^5.4.11",
"vite-plugin-sitemap": "^0.7.1"
}
}

8
pnpm-lock.yaml generated
View File

@@ -84,6 +84,9 @@ importers:
vite:
specifier: ^5.4.11
version: 5.4.11(@types/node@22.10.2)
vite-plugin-sitemap:
specifier: ^0.7.1
version: 0.7.1
packages:
@@ -1478,6 +1481,9 @@ packages:
util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
vite-plugin-sitemap@0.7.1:
resolution: {integrity: sha512-4NRTkiWytLuAmcikckrLcLl9iYA20+5v6l8XshcOrzxH1WR8H0O3S6sTQYfjMrE8su/LG6Y0cTodvOdcOIxaLw==}
vite@5.4.11:
resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -2881,6 +2887,8 @@ snapshots:
util-deprecate@1.0.2: {}
vite-plugin-sitemap@0.7.1: {}
vite@5.4.11(@types/node@22.10.2):
dependencies:
esbuild: 0.21.5

View File

@@ -1,9 +1,19 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import ViteSitemap from 'vite-plugin-sitemap';
export default defineConfig({
plugins: [react()],
plugins: [
react(),
ViteSitemap({
hostname: 'https://www.snigdhaos.org',
outDir: './dist',
changefreq: 'daily',
priority: 0.7,
// lastmod: true,
}),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
@@ -12,14 +22,12 @@ export default defineConfig({
build: {
rollupOptions: {
output: {
// Make sure main.js is generated as part of the build
entryFileNames: 'main.js',
// Output CSS as a separate file (style.css)
assetFileNames: ({ name }) => {
if (name && name.endsWith('.css')) {
return 'style.css'; // Ensure style.css is generated
return 'style.css';
}
return 'assets/[name]-[hash][extname]'; // Other assets (images, etc.)
return 'assets/[name]-[hash][extname]';
},
},
},