[FrameworkBundle] Move AssetMapper internal artefacts in build dir - #65642
#65642Open
smnandre wants to merge 4 commits into
symfony:8.2symfony/symfony:8.2from
smnandre:asset-mapper-compile-cache-dirsmnandre/symfony:asset-mapper-compile-cache-dirCopy head branch name to clipboard
Open
[FrameworkBundle] Move AssetMapper internal artefacts in build dir#65642smnandre wants to merge 4 commits intosymfony:8.2symfony/symfony:8.2from smnandre:asset-mapper-compile-cache-dirsmnandre/symfony:asset-mapper-compile-cache-dirCopy head branch name to clipboard
smnandre wants to merge 4 commits into
symfony:8.2symfony/symfony:8.2from
smnandre:asset-mapper-compile-cache-dirsmnandre/symfony:asset-mapper-compile-cache-dirCopy head branch name to clipboard
Conversation
GromNaN
reviewed
Aug 25, 2026
GromNaN
left a comment
Member
There was a problem hiding this comment.
Wouldn't that cause problems, such as with relative paths or front-end frameworks that use these files?
Member
Author
This is why I introduce a public setting. Rare or specific cases will still be possible :) |
smnandre
force-pushed
the
asset-mapper-compile-cache-dir
branch
from
August 26, 2026 11:16
966d200 to
4a5a497
Compare
GromNaN
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR;
AssetMapper let files publically readable (that list all assets of an app).
This fight any effort to create some "confidentiality" here
(cf all issues wanting to have admin/www assets split and free for scrutiny)
This PR moves assetmapper artefacts in build dir, but maintain per default current behaviour (with a deprecation)
Current situation
asset-map:compilecurrently writes two different kinds of files to the public assetsdirectory:
/public/assetsper default)manifest.json,importmap.jsonandentrypoint.*.json, which are read by PHP only.This makes internal compile metadata publicly accessible and gives it the same deployment
lifecycle as browser assets, even though the two have different consumers.
Changes
This PR adds the
framework.asset_mapper.metadata_diroption. It controls only whereAssetMapper writes and reads its compiled metadata. Digested JavaScript, CSS, images and other
public assets continue to be written to the configured public assets directory.
The 8.2 default remains unchanged for backward compatibility: when the option is not set, the
metadata stays in the public assets directory. Not setting the option is deprecated when the
application actually maps assets, and the default will change to
%kernel.build_dir%/asset_mapperin 9.0.Applications can adopt the future default immediately:
Or they can keep the current location explicitly:
Deployments that adopt the build directory must deploy it together with the public assets.
The deprecation is emitted only when AssetMapper has at least one configured application or
bundle asset path. Empty configurations do not compile metadata and therefore have no location
to choose.
--
Update: renamed
compile_cache_dirinmetadata_dir