From c6e562c62eb1c1654c422a634f4baa32af5b52f2 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 12 Nov 2024 17:44:20 +0800 Subject: [PATCH] Use sonda for JS/CSS bundle analyzer --- .gitignore | 1 + package.json | 1 + vite.config.js | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index c8f96d5f..0e0c6565 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ dist-ssr .env.dev phanpy-dist.zip phanpy-dist.tar.gz +sonda-report.html # Compiled locale files src/locales/*.js \ No newline at end of file diff --git a/package.json b/package.json index fa174292..006694b2 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "postcss": "~8.4.47", "postcss-dark-theme-class": "~1.3.0", "postcss-preset-env": "~10.0.8", + "sonda": "^0.5.0", "twitter-text": "~3.1.0", "vite": "~5.4.10", "vite-plugin-generate-file": "~0.2.0", diff --git a/vite.config.js b/vite.config.js index ed3dbc1d..d39a49f5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,6 +4,7 @@ import { resolve } from 'path'; import { lingui } from '@lingui/vite-plugin'; import preact from '@preact/preset-vite'; +import { SondaRollupPlugin } from 'sonda'; import { uid } from 'uid/single'; import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite'; import generateFile from 'vite-plugin-generate-file'; @@ -149,6 +150,10 @@ export default defineConfig({ type: 'module', }, }), + SondaRollupPlugin({ + detailed: true, + brotli: true, + }), ], build: { sourcemap: true,