TL;DR. 7 manual groups split vendor (initial × 3 tiers + async × 3 tiers) + initial app code; async app code is left to rolldown's auto-chunking. Config: libs/nx/plugin/vite/src/executors/build/executor.ts.
| import { ExecutorContext } from '@nx/devkit'; | |
| import browserslist from 'browserslist'; | |
| import browserslistToEsbuild from 'browserslist-to-esbuild'; | |
| import assert from 'node:assert'; | |
| import path from 'node:path'; | |
| import { build } from 'vite'; | |
| import { getBuildTargetConfig } from '@cu/nx-plugin-bundler/common/nx/target-config/get-target-config'; | |
| import { getPlugins } from '../../common/get-plugins'; |
A real‑network evaluation of four chunking configs on LobeHub's
Vite SPA. Two baselines (Rolldown default codeSplitting: true
and the repo's previous manualChunks), the Rolldown
codeSplitting.groups recipe from [the gist][gist], and a refined
"best practice" variant that fixes the recipe's lazy‑loading
regression on this codebase. Companion piece to the App‑X case
study; shows where the gist recipe doesn't transfer cleanly
and why.
| name | vue-tsc-compiler-options |
|---|---|
| description | Configures Vue 3 template type checking via vueCompilerOptions in tsconfig.app.json. Covers strictTemplates, checkUnknownComponents, checkUnknownProps, checkUnknownEvents, and checkUnknownDirectives. Use when setting up vue-tsc, diagnosing unknown component errors, or enabling strict template validation. |
Add vueCompilerOptions to the tsconfig that includes Vue source files. In projects with multiple tsconfigs, this is typically tsconfig.app.json, not the root tsconfig.json or tsconfig.node.json.
| name | ast-grep-search |
|---|---|
| description | Syntax-aware code searching that understands code structure rather than just text patterns. Always prefer ast-grep than grep for code searches. |
| allowed-tools | Read, Grep, Bash(ast-grep:*), Bash(sg:*) |
ast-grep allows searching code based on its Abstract Syntax Tree (AST), enabling syntax-aware pattern matching. It is ideal for finding function calls, method invocations, variable declarations, and other code structures while respecting language syntax.
- rolldown par plugin
- We now have a example folder to benchmark parallel js plugin using hyperfine. This is for reducing the overhead of initializing worker repeatedly.
- https://github.com/rolldown/rolldown/blob/0e60949b00c1a21168487afe6b49be30a49b02dc/examples/par-plugin/package.json
- Performance gain
- For threejs10x case, let's assume there's a plugin that need transform every module and takes 1ms for each module.
-
Benchmark 1: pnpm rolldown -c ./cases/noop-threejs10x/par-noop.rolldown.config.js Time (mean ± σ): 756.3 ms ± 24.7 ms [User: 5008.5 ms, System: 442.0 ms] Range (min … max): 736.6 ms … 784.1 ms 3 runs
-
- For threejs10x case, let's assume there's a plugin that need transform every module and takes 1ms for each module.