-
Notifications
You must be signed in to change notification settings - Fork 576
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
add customFragmentsInScripts option #716
base: gh-pages
Are you sure you want to change the base?
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.