Skip to content

Return output write errors from external minifiers - #1033

Merged
tdewolff merged 2 commits into
tdewolff:masterfrom
jackwalkerlabs:fix/command-output-errors
Sep 9, 2026
Merged

tdewolff merged 2 commits into
tdewolff:masterfrom
jackwalkerlabs:fix/command-output-errors

Conversation

@jackwalkerlabs

Copy link
Copy Markdown
Contributor

When an external minifier writes through a $out file, the deferred copy to the caller's writer discards its error. A failed write or short write consequently looks like successful minification.

Copy the command's output before returning and propagate copy errors when the command itself succeeded. Preserve the command error if the subprocess failed. Regressions verify both a writer returning an error and a short write; both returned nil on the base revision.

Validation: go test -race ., go vet ., gofmt and git diff --check pass on Go 1.27.1 / macOS arm64. The broader suite has an independently verified base failure in minify/TestMinify (missing initial SVG M); broad vet also reports existing unkeyed JS AST literals.

Disclosure: Codex implemented and tested this change under the submitting account's authorization.

@tdewolff
tdewolff merged commit b59b843 into tdewolff:master Sep 9, 2026
5 of 17 checks passed
@tdewolff

tdewolff commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants