-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Optimization of inline scripts behaves differently with default settings vs explicitly defined minification #20207
Comments
Hi @kmaraz, Inline scripts should never be optimized. I noticed that you are using Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via This might be related to your directory structure so its really important to get an accurate repro to diagnose this. |
I'll do it, thanks! |
Hi @alan-agius4, here it is: https://github.com/kmaraz/angular-optimization-bug When I was testing it I have found the bug: When the setting is:
Everything is correct. When the setting is:
Everything is correct. But when I set:
Then the code inside <script> tag is processed and broken. Script in index.html before:
Script in index.html after (as seen in dist directory in the repo):
Is there anything else I can do? |
…tributes empty values Closes #20207
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Description
In the documentation for Optimization configuration https://angular.io/guide/workspace-config#optimization-configuration it is stated that:
So based on default values mentioned in the documentation I thought that
is the same as:
But the two behaves differently. The explicit configuration of
optimization.scripts = true
option turns on aggresive minification of inlined <script>s in the index.html which is not enabled when onlyoptimization = true
is set.Did I get it wrong and it should behave differently?
🌍 Your Environment
Angular Version:
The text was updated successfully, but these errors were encountered: