fonc: précompresse les ressources CSS et JS

This commit is contained in:
gcch 2025-06-24 12:19:47 +02:00
commit ee7d8c8ff7
6 changed files with 99 additions and 19 deletions

View file

@ -4,6 +4,7 @@ import { resolve } from "node:path";
import process from "node:process";
import * as v from "valibot";
import { defineConfig, loadEnv } from "vite";
import { compression } from "vite-plugin-compression2";
import manifestSRI from "vite-plugin-manifest-sri";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import valibot from "vite-plugin-valibot-env";
@ -66,6 +67,14 @@ export default defineConfig(async ({ mode }) => {
"chrome >0 and last 3 years, edge >0 and last 3 years, safari >0 and last 3 years, firefox >0 and last 3 years, and_chr >0 and last 3 years, and_ff >0 and last 3 years, ios >0 and last 3 years",
renderLegacyChunks: false,
}),
compression({
algorithms: [
"brotliCompress",
"gzip",
"zstandard",
],
threshold: 1000,
}),
],
};
});