wyrihaximus/js-compress
Compress and minify JavaScript in PHP with wyrihaximus/js-compress, a small library that wraps a JS compressor behind a simple API so you can shrink assets during your build or at runtime.
wyrihaximus/compress family rather than as a standalone Laravel-native tool. If your architecture already uses that middleware approach, this is a cheap slot-in; if not, it is an orphan dependency.Consider it when most of the following hold:
npm to the pipeline is genuinely blocked (locked-down hosting, shared hosting, a PHP-only container image, air-gapped or plugin sandboxes).wyrihaximus/compress middleware ecosystem, so the contracts and integration cost are near zero.Look elsewhere when:
tedivm/jshrink (more widely used, similar scope), a Node-based step (esbuild, terser) invoked from a Laravel command, or a CDN/edge optimizer.For executives (one line): A small, MIT-licensed PHP utility that shrinks JavaScript without a Node build step — useful only in the narrow case where our stack cannot run Node; not a fit for our standard Laravel front end, where Vite already handles this.
For engineering: It is a compressor implementation for the wyrihaximus/compress asset middleware, letting PHP minify JS inline. It removes a Node dependency from the deployment, at the cost of lower compression quality, no source maps, and a single-maintainer project with effectively no adoption (4 stars, 0 dependents). Recommendation: do not adopt for the main app — keep Vite. Revisit only if we hit a concrete PHP-only constraint (e.g., a plugin sandbox that must compress tenant-supplied JS server-side); in that case, prototype it against tedivm/jshrink and a Node-based alternative, and compare output size, latency, and maintenance burden before choosing. If we do adopt, pin the version, wrap it behind our own interface so it is swappable, and precompute compressed assets rather than minifying on every request.
How can I help you explore Laravel packages today?