-
-
Notifications
You must be signed in to change notification settings - Fork 139
Missing assets in Twig autocompletation when using manifest.json and Webpack-Encore versioning #1020
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
Have same issue. Also there is another problem: project with remote sources by sftp, encore runned on remote server (actually docker) - and manifest.json should be downloaded on each rebuild. |
Have the same problem, the issue is that the manifest file is not checked by the Symfony Plugin. On the hard drive the filename contains also the hash, so it never finds it. This is a new feature, any plans or ETA for implementing it? |
This is how I solved: In your main JS file (where you define all
This isn't strictly necessary to fix your issue, but it forces Encore to copy all image files over to In your
The important part is the if/else:
If in dev, do not use hashes; if in prod, use hashes. Of course make sure |
both webpack / encore files are supported now |
I configured my project to use webpack encore to handle assets with versioning following this guide, but twig can't suggest me the correct file.
My configuration is this:
in config.yml I have put this:
in my webpack.config.js I have this
to enable versioning.
after running encore, my manifest.json become like this
this map my assets name to a new name with the version number. But obviously this change every time I edit my assets and run encore. Symfony knows how to handle this by reading the manifest.json file and place the mapped name of the asset (to better understand this read the guide).
But in any of my twig templates, the plugin can suggest me only the assets with the version number because they are the only who phisically exist.
I think it would be useful if the plugin can understand I'm using a manifest.json and suggest me the general asset name instead of alert of a missing asset.
let me know if you understand the problem
thank you
Lorenzo
The text was updated successfully, but these errors were encountered: