Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions packages/rstack/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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,
},
Comment thread
chenjiahan marked this conversation as resolved.
},
},
],
},
},
});
1 change: 1 addition & 0 deletions scripts/dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Custom Dictionary Words
fnames
llms
oxfmt
rsbuild
Expand Down