From 9b110e8f3f08c6d46b958fe32609e7257cd57227 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 22 Jul 2026 13:08:26 +0800 Subject: [PATCH 1/2] perf: fully minify bundled lint-staged code --- packages/rstack/rslib.config.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/rstack/rslib.config.ts b/packages/rstack/rslib.config.ts index 413b97b..2da82de 100644 --- a/packages/rstack/rslib.config.ts +++ b/packages/rstack/rslib.config.ts @@ -1,6 +1,8 @@ import { defineConfig } from '@rslib/core'; import pkgJson from './package.json' with { type: 'json' }; +const fullyMinifiedChunks = /lintStaged\.js$/; + export default defineConfig({ lib: [{ syntax: 'es2023', dts: true }], source: { @@ -24,5 +26,26 @@ export default defineConfig({ // Rstack always passes an explicit config object to lint-staged, so its // optional YAML config loader is not used. externals: ['jiti', 'yaml'], + minify: { + js: true, + css: false, + jsOptions: [ + { + // Fully minify the bundled lint-staged code to reduce package size. + include: fullyMinifiedChunks, + }, + { + exclude: fullyMinifiedChunks, + minimizerOptions: { + // Preserve variable names and disable minification for easier debugging. + mangle: false, + minify: false, + compress: { + keep_fnames: true, + }, + }, + }, + ], + }, }, }); From 0e41064a0de994e7f1c597f0476212b4ef5ba934 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 22 Jul 2026 13:13:30 +0800 Subject: [PATCH 2/2] chore: add fnames to dictionary --- scripts/dictionary.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/dictionary.txt b/scripts/dictionary.txt index a785e9b..fac486c 100644 --- a/scripts/dictionary.txt +++ b/scripts/dictionary.txt @@ -1,4 +1,5 @@ # Custom Dictionary Words +fnames llms oxfmt rsbuild