Skip to main content
Detects unminified JavaScript that could be optimized
Rule IDperf/unminified-js
CategoryPerformance
ScopePer-page
Severitywarning
Weight5/10

Solution

Minify JavaScript to reduce file size and improve load times. Use build tools like Terser, esbuild, or UglifyJS. Most bundlers (Webpack, Vite, Rollup) minify automatically in production. Minification shortens variable names, removes whitespace, and dead code.

Options

This rule supports the following configuration options:
OptionTypeDefaultDescription
min_size_bytesunknownundefinedMinimum JS size in bytes to check for minification

Configuration Example

squirrel.toml
[rules."perf/unminified-js"]
min_size_bytes = undefined

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["perf/unminified-js"]

Disable all Performance rules

squirrel.toml
[rules]
disable = ["perf/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["perf/unminified-js"]
disable = ["*"]