symfony/asset-mapper
Symfony AssetMapper exposes asset directories, copies them to a public folder with digested/versioned filenames, and can generate an importmap so you can use modern JavaScript modules without a build step.
FrameworkBundle, requiring Laravel-specific wrappers (e.g., service providers, Blade tweaks) for seamless integration. The package’s asset mapping and importmap generation align with Laravel’s static asset needs but lack native Laravel integrations (e.g., public_path(), mix-manifest.json).?v=1.2 versioning with hash-based filenames (e.g., app.[hash].js), reducing frontend bugs and improving caching.importmap.json.public/ directory (Symfony assumes public/ is the root).AssetMapper may clash with Laravel’s service container or event system, requiring custom service providers or monkey-patching./build/app.[hash].js) may not align with Laravel’s default asset() helper, necessitating custom Blade directives or URL rewrites.config('view.compiled')) might interfere with the package’s runtime asset mapping, requiring cache invalidation strategies.asset('js/app.js') vs. Symfony’s /build/app.[hash].js)?mix-manifest.json or will we need a custom manifest generator?<link rel="modulepreload">) interact with Laravel’s asset optimization?/about, /contact).AssetMapper as a service.public/ assumption with Laravel’s public_path().asset() helper or add @assetMap directives for importmap injection.importmap:require as a Laravel command (e.g., php artisan asset:map).?v=1.2 versioning with digested filenames.importmap.json.| Step | Priority | Effort | Dependencies |
|---|---|---|---|
| Research | High | Low | None |
| Service Provider | Medium | Medium | Symfony AssetMapper |
| Blade Directives | High | Medium | Service Provider |
| Artisan Commands | Low | Low | Service Provider |
| Pilot Deployment | High | High | Blade Directives, Service Provider |
| Full Migration | Critical | High | Pilot Success |
| Documentation | Medium | Medium | All Integrations |
?v=1.2 versioning or custom hashing scripts.AssetMapper features (importmap, asset mapping).importmap.json mitigates overhead; pre-generation (e.g., during deploy) is recommended for high-traffic sites.| Scenario | Impact | Mitigation Strategy |
|---|---|---|
| Missing asset files | Broken links, JS/CSS failures | Fallback to original filenames or 404s |
| Circular imports in importmap | Infinite loops, app hangs | Symfony’s SequenceParser (fixed in |
How can I help you explore Laravel packages today?