| Rule ID | perf/js-file-size |
| Category | Performance |
| Scope | Site-wide |
| Severity | error |
| Weight | 7/10 |
Solution
Large JavaScript files block the main thread and delay interactivity. Code-split bundles into smaller chunks, tree-shake unused exports, lazy-load non-critical scripts, and defer or async load third-party scripts. Use dynamic imports for route-based splitting.Options
This rule supports the following configuration options:| Option | Type | Default | Description |
|---|---|---|---|
warn_bytes | number | 256000 (250KB) | Byte size to trigger warning |
error_bytes | number | 1048576 (1MB) | Byte size to trigger error |
Configuration Example
squirrel.toml
Enable / Disable
Disable this rule
squirrel.toml
Disable all Performance rules
squirrel.toml
Enable only this rule
squirrel.toml