-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Description
When providing paths
configuration for twig templates all files in those paths are handled as templates which leads to cache:warmup
crashes when paths contain non twig templates because of invalid syntax.
Example
# twig.yaml
twig:
extensions:
- .html.twig
- .html
Context
I have to serve an angular app through symfony server because the source code should be protected by security firewall.
Angular project is located in separate directory.
To deploy into Symfony I:
- build angular app
- copy build output to symfony project
- have twig path configured to target build output based on environment
# twig.yaml
twig:
paths:
"angular/webapp/dev": "webapp"
Then in my controller I can render app template and inject configuration:
// controller pseudo code
class Controller {
public function index() {
return $this->render("webapp/index.html", $data);
}
}
This worked in Symfony 4 but after upgrading to Symfony 5 i encounter template syntax error on cache:warmup
and :clean
because angular directory contains javascript files which are not valid twig templates.
An option to filter files by extension would solve this problem.