symfonycasts/sass-bundle
A Symfony bundle that compiles Sass/SCSS to CSS using Dart Sass and integrates with AssetMapper. It provides build and watch commands, source maps, and simple configuration for modern asset pipelines.
Architecture fit. symfonycasts/sass-bundle is a Symfony bundle, not a Laravel package. It registers a DI extension and config tree, hooks into the AssetMapper pipeline, and compiles .scss in PHP (via the scssphp compiler family) rather than shelling out to dart-sass. Its architectural thesis — "delete Node from the asset pipeline" — is the only thing directly reusable in a Laravel context. The bundle itself cannot be installed into a Laravel app; it expects Symfony's kernel, AssetMapper, ImportMap, and Symfony console wiring.
Integration feasibility. Two honest options: (1) treat it as a reference architecture and reimplement the pattern in Laravel over scssphp/scssphp plus a small artisan command and service provider; (2) do not integrate, and revisit only if a maintained Laravel adapter appears. Direct composer require is not feasible. There is no Laravel service provider, no config publishing, no Blade/Vite bridge.
Technical risk.
scssphp has historically lagged dart-sass on the module system (@use/@forward, sass:math/sass:map built-in modules), newer CSS features, and edge-case output fidelity. Any parity gap converts into either a build failure or a silent visual regression.scssphp dependency tree still needs composer audit coverage.Key questions.
scssphp at our pinned version support every Sass feature in our stylesheet graph (@use, @forward, built-in modules, custom importers, ~package / pkg: resolution)?dart-sass?Stack fit. Poor as a dependency, moderate as a pattern. Our incumbent is Laravel + Vite + npm-installed sass (dart-sass). That pipeline is well-understood, fast, and CI-cached. The case for change is narrow: eliminating a Node toolchain from build and CI images, typically motivated by security scanning surface, image size, or a PHP-only platform team.
Options, ranked.
scssphp/scssphp, write a sass:build artisan command plus a service provider, compile at deploy/first-boot into public/build, hash outputs, and point Blade at the manifest. Estimated 200–500 lines of glue with tests.Migration path (if option 2 is chosen).
.scss/.sass files, catalog used features (@use, @forward, mixins, functions, custom importers, node_modules resolution style).dart-sass version and generate golden-file CSS output for every entrypoint; commit as fixtures.Compatibility considerations.
@vite-style helpers (or a replacement) resolve correctly..scss paths for editor and Sentry integration.Sequencing.
Maintenance. If we depend on the bundle directly (Symfony case), we inherit the Symfony release train and the bundle's own upgrade cadence. If we copy the pattern, we own the glue plus a scssphp upgrade treadmill, including periodic parity checks against dart-sass releases. Budget roughly 1–2 engineer-days per quarter, spiking around PHP or Sass major versions. Low star count means the upstream will not absorb our edge cases.
Support. No SLA, no commercial vendor relationship implied by MIT. Support is GitHub issues plus SymfonyCasts' paid course material, which is educational rather than contractual. The realistic escalation path for any defect is a local fork — factor that into the risk register and keep the fork shallow.
Scaling. Compilation is CPU-bound, single-process PHP, and build time grows superlinearly with import-graph depth. Mitigations: cache outputs keyed on file-content hashes, compile per entrypoint in parallel worker processes, reuse CI artifacts across jobs, enable opcache/JIT for the compile step. Runtime scaling is unaffected and arguably improved — the output is static CSS with no request-time Sass work. The cost lands on deploy duration and CI minutes, not on p99 latency.
Failure modes.
scssphp does not implement.@use/@forward semantics, blocking a release.Ramp-up. Using Sass is a non-event for any front-end-capable engineer. Owning the PHP compiler layer is not: it requires understanding custom importers, source-map generation, and the compiler's error model. Expect 2–3 days to a working spike, 1–2 weeks to something production-grade with tests and CI. The real risk is knowledge concentration — one owner, undocumented behavior. Mitigate with the golden-file suite, a written runbook, and at least two engineers touching the adapter before it ships.
How can I help you explore Laravel packages today?