Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Uglify Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for asset minification. The package answers a narrow question: do we need a Node toolchain in production/build, or can PHP handle minification? It buys you a dual-path implementation (shell out to 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.
  • Deployment-target feasibility. Useful input when deciding whether to support constrained hosting (shared hosting, locked-down PaaS, customer-managed on-prem boxes) where Node cannot be assumed. If a segment of your customer base looks like this, this package quantifies how cheap the "no-Node" path can be.
  • Runtime vs. build-time asset pipeline. A decision point for products that must minify at request/install time — CMS themes, plugin systems, multi-tenant sites where tenants upload their own CSS/JS, or admin "custom CSS" features. This is the one place a PHP-side minifier has a real product rationale.
  • Scope control on a bigger roadmap item. If an "asset optimization" epic is on the roadmap, a 1–2 day spike with this package can produce a credible cost estimate for the DIY path and a concrete argument for the "just require Node/Vite" path.
  • Migration/exit planning. Because it is a thin wrapper, it clarifies the blast radius of swapping minifiers later — informative when deciding whether to abstract minification behind an internal interface.

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.

When to Consider This Package

Consider it when all of the following hold:

  • You must minify from PHP at runtime (not at build time), because assets are user-supplied or generated dynamically.
  • You cannot guarantee Node in the target environment, but you can opportunistically use it where present.
  • The asset set is small and non-critical-path (admin CSS, tenant themes) so a slower pure-PHP fallback is acceptable.
  • You are willing to vendor/fork it or accept an unmaintained dependency, since there has been no release since 2019 and there are no dependents to surface breakage.

Look elsewhere — usually — when any of these hold:

  • You use Laravel's standard toolchain. Vite (or Mix) already compiles and minifies at build time. Adding a runtime minifier here is duplicated effort and a second source of truth for asset output.
  • You need modern JavaScript support. 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.
  • You want maintained dependencies. Zero dependents plus a 2019 release means no security patch flow, no PHP 8.x guarantees to rely on, and no community pressure to fix regressions. For a supply-chain-sensitive product this is disqualifying without a fork commitment.
  • You need source maps, content hashing, chunking, or cache-busting. None of that is in scope for a minifier wrapper.
  • You control the build. If you can simply install Node in CI, use the real tools directly; the wrapper's entire value proposition disappears.
  • You only want the PHP fallback. You are likely better off depending on the underlying PHP minifier directly (e.g. 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.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle