Skip to content
Open
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
13 changes: 13 additions & 0 deletions .github/workflows/pre-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ jobs:
- uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Detect Node major version
run: echo "NODE_MAJOR=$(node -p 'process.versions.node.split(".")[0]')" >> $GITHUB_ENV
- run: npm ci
- name: Cache Webpack filesystem cache
uses: actions/cache@v4
with:
path: |
.cache/webpack
node_modules/.cache/webpack
key: ${{ runner.os }}-node${{ env.NODE_MAJOR }}-webpack-${{ hashFiles('**/package-lock.json', 'build.mjs') }}
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache key uses NODE_MAJOR but actions/setup-node's built-in cache uses the full Node version. This mismatch could cause cache hits across different Node patch versions, potentially leading to compatibility issues if webpack cache format changes between Node versions. Consider using the full Node version or removing NODE_MAJOR from the key since package-lock.json and build.mjs already provide sufficient versioning.

Copilot uses AI. Check for mistakes.
restore-keys: |
${{ runner.os }}-node${{ env.NODE_MAJOR }}-webpack-
- run: npm run build

- uses: josStorer/get-current-time@v2
Expand Down
20 changes: 20 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ Always reference these instructions first and fall back to search or bash comman
- Lint code: `npm run lint` -- uses ESLint.
- Safari build: `npm run build:safari` (see Platform-Specific Instructions for details)

### Build Performance Options

- BUILD_PARALLEL: Toggle parallel build of production variants
- Default: on (parallel). Set to `0` to run sequentially (lower CPU/IO spikes on low-core machines)
- BUILD_THREAD / BUILD_THREAD_WORKERS: Control Babel parallelism via thread-loader
- Default: threads enabled in dev/prod; workers = CPU cores
- Set `BUILD_THREAD=0` to disable; set `BUILD_THREAD_WORKERS=<n>` to override worker count
- BUILD_CACHE_COMPRESSION: Webpack filesystem cache compression
- Default: `0` (no compression) for faster warm builds on CPU-bound SSD machines
- Options: `0|false|none`, `gzip` (or `brotli` if explicitly desired)
- Affects only `.cache/webpack` size/speed; does not change final artifacts
- BUILD_WATCH_ONCE (dev): When set, `npm run dev` runs a single build and exits (useful for timing)
- BUILD_POOL_TIMEOUT: Override thread-loader production pool timeout (ms)
- Default: `2000`. Increase if workers recycle too aggressively on slow machines/CI
- BUILD_RESOLVE_SYMLINKS: When set to `1`/`true`, re-enable Webpack symlink resolution for `npm link`/pnpm workspace development (default off to avoid duplicate module instances)
- Source maps (dev): Dev builds emit external `.map` files next to JS bundles for CSP-safe debugging; production builds disable source maps
- Symlinks: Webpack uses `resolve.symlinks: false` to improve performance and ensure consistent module identity; use `BUILD_RESOLVE_SYMLINKS=1` when you need to work with linked dependencies locally

Performance defaults: esbuild handles JS/CSS minification. In development, CSS is injected via style-loader; in production, CSS is extracted via MiniCssExtractPlugin. Thread-loader is enabled by default in both dev and prod.

### Build Output Structure

Production build creates multiple variants in `build/` directory:
Expand Down
Loading