-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Encore manifest.json, assets package base_path #36844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Edit: No. That was merged in 5.1. |
Confirming this happens in 5.1.3
We use different asset folders for prod & dev, and after I've added different base_path for dev & prod (code above), in prod env version is not added to path (it seems that it only applies base_path but not version), in dev mode everything works, because there is no version, so there isnt problem. example and I expect |
Hey, thanks for your report! |
Just a quick reminder to make a comment on this. If I don't hear anything I'll close this. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
I faced the same problem when using two packages with different base_path After looking into how the base_path is applied, I the simple solution and wanted to share it. If you have set the base_path for the admin package to /build/admin/
You must do it like this: {
"admin.js": "/build/admin/admin.b991d27f.js",
"runtime.js": "/build/admin/runtime.2dd405e4.js"
} Now using
will work as expected and result in
If you are using Webpack Encore then it is simple to fix the prefixing in the manifest.json by using the // Admin config
Encore
.setOutputPath('public/build/admin/')
.setPublicPath('/build/admin')
.setManifestKeyPrefix('') // <- Setting the Prefix to '' (empty string) will overwrite the /build/admin/ being added to the keys in the manifest.json file
// Rest of config... |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version:
5.0.7
Description
assets.packages.base_path
is not used withjson_manifest_path
.For example, this is my
manifest.json
:This is my
assets.yaml
:When I call
asset()
function from Twig, omitting thebase_path
prefix,manifest.json
is ignored:If to provide full path to
asset()
function, it renders the correct file name (with postfix).I.e. if I want to use
manifest.json
I have to specify a full path regardless ofbase_path
provided.The text was updated successfully, but these errors were encountered: