Problem
I have a body.html which uses {% javascript_pack 'main-bundle' attrs='charset="UTF-8"' %}
and a detail.html which uses {% javascript_pack 'detail' attrs='charset="UTF-8"' %}
it also extends with {% extends 'body.html' %}
This causes 'detail.js' to be called twice.
It works if i use {% javascript_pack 'main-bundle' 'detail' attrs='charset="UTF-8"' %} in body.html, but now i load unnessessary js-code.
Reproduce
Use this:
{% javascript_pack 'main-bundle' attrs='charset="UTF-8"' %} {% javascript_pack 'detail' attrs='charset="UTF-8"' %}
with simple debug line each:
console.log("DEBUG-"+(new Date()).getTime());
You will see 3 console-lines instead of 2.
Question
Am i supposed to only use javascript_pack once?
Problem I have a body.html which uses {% javascript_pack 'main-bundle' attrs='charset="UTF-8"' %}
and a detail.html which uses {% javascript_pack 'detail' attrs='charset="UTF-8"' %} it also extends with {% extends 'body.html' %}
This causes 'detail.js' to be called twice.
It works if i use {% javascript_pack 'main-bundle' 'detail' attrs='charset="UTF-8"' %} in body.html, but now i load unnessessary js-code.
Reproduce Use this:
{% javascript_pack 'main-bundle' attrs='charset="UTF-8"' %} {% javascript_pack 'detail' attrs='charset="UTF-8"' %}
with simple debug line each:console.log("DEBUG-"+(new Date()).getTime());
You will see 3 console-lines instead of 2.Question Am i supposed to only use javascript_pack once?