nodejs-php-fallback/less
Compiles LESS to CSS from PHP, using Node.js lessc when available and falling back to a pure-PHP compiler when it isn’t. Ideal for Laravel/PHP asset pipelines that need reliable LESS builds without a mandatory Node.js dependency.
less npm CLI) or inside PHP. This wrapper exists specifically to defer that decision to runtime by trying Node first and falling back to a pure-PHP compiler. That's an architecture decision, not a feature.Consider it only when all of the following hold:
Look elsewhere when:
lessc directly in your build script — the wrapper adds a dependency and a failure mode for no gain.Executives (one paragraph): "This is small plumbing, not a product capability. It lets a PHP application compile LESS stylesheets without requiring Node.js on production servers — valuable only if we have a legacy app running on a constrained host. It is effectively unmaintained (last release 2019, no downstream dependents), so we should not adopt it for new work. At most it's a temporary bridge with a dated exit plan; the strategic direction is a standard Node-based build (Vite + Sass), which we already recommend for new projects."
Engineering (summary):
"It wraps the less npm package and falls back to a pure-PHP LESS compiler when Node isn't present. That buys environment portability at the cost of two divergent compiler paths — output can differ subtly and debugging spans two toolchains. If we use it: pin the version, hide it behind our own asset-compiler interface, ensure CI exercises the Node path so at least one branch is tested, confirm the PHP fallback's maintenance/CVE status, and attach a removal ticket. MIT license, so no legal friction. For anything new, skip it: Vite plus Dart Sass, compile in CI, ship static CSS."
How can I help you explore Laravel packages today?