-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Compile function return comments (even if explicitly set "no comments" option) #3392
Labels
Comments
DV8FromTheWorld
added a commit
to DV8FromTheWorld/vue-next
that referenced
this issue
Jul 13, 2021
…n development Close: vuejs#3392 Replace: vuejs#3395
According to docs:
This is intended behavior unless the comments are present in production. Or is there any particular reason you want comments removed during development? |
Yes, there is a reason. I'm running dev version of Vue because I want to
see any issues while, you know, developing. But, result I need is complied
template for, you know, production, so I got this issue when I can't have
it without comments, which I would say frustrating.
From other point, I found work around by resetting global variable before
compiling, which is working like a charm, and setting it back after.
чт, 15 лип. 2021, 22:53 користувач Evan You ***@***.***> пише:
… According to docs
<https://v3.vuejs.org/api/application-config.html#compileroptions-comments>
:
By default, Vue will remove HTML comments inside templates in production.
Setting this option to true will force Vue to preserve comments even in
production. *Comments are always preserved during development.*
This is intended behavior unless the comments are present in production.
Or is there any particular reason you want comments removed during
development?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3392 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGJKBZAISKHOARZ44LTPDGTTX44ERANCNFSM4Y2KR72Q>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
3.0.7
Reproduction link
https://jsfiddle.net/akgpf058/
Steps to reproduce
See result where comment nodes are in place (even with
comments: false
option):What is expected?
Returned result without comment nodes being rendered.
What is actually happening?
Comment nodes are in place:
_createCommentVNode(" COMMENT HERE ")
I would appreciate any feedback on how to precompile template without comment nodes, my understanding that Vue has option to remove comment nodes from template, but I can be misreading source code, let me know if there any other way to make
Vue.compile
trim comments (there are should be one, I guess?).The text was updated successfully, but these errors were encountered: