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

Disable mergeScripts & mergeStyles in safe preset #170

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

SukkaW
Copy link
Contributor

@SukkaW SukkaW commented Dec 2, 2021

Consider a case:

<template>
  <!-- Maybe used in shadow dom or something -->
  <script>/* I shouldn't be executed when page is loaded! */</script>
</template>

htmlnano's mergeScripts and mergeStyles can't detect such a case and may cause unwanted behaviors by extracting and merging them to the top level.

There are many ways for a developer to make their own template (E.g. <script type="mySecretTemplate"><script>/* I shouldn't be executed when page is loaded! */</script></script>) and there is no way for htmlnano can identify them all. Thus those two features should be disabled in v2 by default.

Those two features can retain enabled by default in v1 since we haven't received any bug reports about the issue, yet.

@netlify
Copy link

netlify bot commented Dec 2, 2021

‼️ Deploy request for htmlnano rejected.

Name Link
🔨 Latest commit e33353c

@maltsev maltsev merged commit e72c5b7 into posthtml:v2 Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants