Use sonda for JS/CSS bundle analyzer

This commit is contained in:
Lim Chee Aun 2024-11-12 17:44:20 +08:00
parent b70e31a517
commit c6e562c62e
3 changed files with 7 additions and 0 deletions

1
.gitignore vendored
View file

@ -27,6 +27,7 @@ dist-ssr
.env.dev
phanpy-dist.zip
phanpy-dist.tar.gz
sonda-report.html
# Compiled locale files
src/locales/*.js

View file

@ -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",

View file

@ -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,