Skip to content
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

fix: dont' minimize non-javascript inline scripts #517

Merged
merged 1 commit into from Feb 22, 2022
Merged

fix: dont' minimize non-javascript inline scripts #517

merged 1 commit into from Feb 22, 2022

Conversation

wynksaiddestroy
Copy link
Contributor

@wynksaiddestroy wynksaiddestroy commented Feb 2, 2022

Commit e61db62 introduced the minification of inline JavaScript.
Unfortunately this feature tries to minify the content of any <script> tag that is inserted into the <head>.
A <script> tag can contain not only JavaScript, but also JSON for example.
Therefore this won't work:

module.exports = {
  head: [
    ['script', { type: 'application/ld+json' }, '{ "foo": "bar" }']
  ]
}

A detailed bug report can be found here: #538

You can't add a script tag to the head which has content that is not valid JavaScript code (JSON for example).
This won't work:
```html
module.exports = {
  head: [
    ['script', { type: 'application/ld+json', '{ "foo": "bar" }']
  ]
}
```
@yyx990803 yyx990803 merged commit 779b789 into vuejs:main Feb 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants