nodejs-php-fallback/uglify
A PHP fallback for UglifyJS that minifies JavaScript without needing Node.js installed. Keeps asset pipelines simple in Laravel and PHP projects by providing a native minifier when Node is unavailable.
uglify-js/clean-css when Node exists, degrade to a pure-PHP minifier when it doesn't) instead of you writing and maintaining that branching logic.Not supported: anything strategic. With 17 stars, zero dependents, and a last release in January 2019, this is not a signal of ecosystem direction and should not anchor roadmap commitments.
Consider it when all of the following hold:
Look elsewhere — usually — when any of these hold:
uglify-js predates broad ES2015+ handling; terser is the maintained successor. If your inputs are modern JS, the Node path will fail or degrade, and you'll silently fall back to the weakest link.matthiasmullie/minify — verify which fallback this wrapper actually uses) and dropping the unmaintained middle layer. You get the same output with a maintained dependency and one less abstraction.To executives: This is a small, low-cost utility, not a platform bet. It lets our PHP application minify JavaScript and CSS without requiring Node.js to be installed everywhere we deploy, which matters only if we intend to support constrained or customer-hosted environments. The honest caveats: it has 17 GitHub stars, no downstream dependents, and hasn't shipped a release since early 2019 — so treat it as a candidate for a timeboxed spike, not a dependency we standardize on. Recommendation: fund a 1–2 day evaluation, with a default bias toward either the underlying PHP minifier directly or a build-time pipeline.
To engineering: The package is a thin, MIT-licensed dispatcher: it shells out to uglify-js/clean-css when Node is available and falls back to a pure-PHP minifier otherwise. Two consequences. First, that fallback is the real product — if we adopt, we should evaluate the fallback library on its own merits and consider depending on it directly. Second, "unmaintained since 2019" means we own patching, PHP-version compatibility, and any uglify-js ES6+ gap (the maintained equivalent is terser). Ask: do we actually need runtime minification, or is this a build-step problem we're solving in the wrong layer? Expected effort to trial: half a day to wire up, one day to characterize output parity and failure modes across Node-present and Node-absent environments. Exit criteria: if the fallback output is materially worse or the wrapper needs patches to run on our PHP version, we stop and go direct.
How can I help you explore Laravel packages today?