add customFragmentsInScripts option#716
Conversation
647b148 to
959b741
Compare
|
Can this not be implement with |
|
@alexlamsl I believe not :( Custom fragments were replaced by the placeholders at that moment, so you can't easily find out whether there's a customFragment inside the script. Setting |
|
Right you are. 👍 I think rather than introducing this flag, if we can literally make this custom fragment case works by default that would be better. So if this option you've introduced work without any regressions, we might as well have this behaviour by default. Failing that, I still prefer offloading this to a custom Would this work if I were to restore all the substitutions before passing the script string to |
|
So coming back to this. One way to think of it is that So I think the flag you've introduced is probably quite a good solution to this issue. A few things:
|
It leads to an issue with following html fragment:
After minified, it becomes:
The trailing comma leads to a syntax error.
The only method I found is to prevent minifying javascripts when there's a customFragment inside the script tag.