Make it possible to retain html comments
Please note, that this request is concerning vue sfc files. (.vue-files)
What problem does this feature solve?
For technologies like server-side-includes it is really important to retain html comments in certain scenarios. There was an option to retain them for vue-2 (https://vuejs.org/v2/api/#comments), however, that seems to be removed from vue-3 :( I could not find anything concerning this feature in the vue-3 docs.
What does the proposed API look like?
an option would be to keep the v-2 api
This was added at https://github.com/vuejs/vue-next/pull/1858
Hi, thanks for your swift response. I am not sure if I understand the context of your linked PR & issue, but to me it sounds like only useful in a situation where I am using the parse() function of vue/compiler-core. In my scenario, I am creating a new instance of a vue component inside of a sfc file. In vue2, the comments: <boolean> option was exposed directly in the options of a component, however that api has now changed (because if configured there, the comments are still lost), and I do not understand where I would specify that option now.
hi vhoyer, I have just tried that and sadly, it did not preserve my comments. ty for the input though
From what I gather, the <template comments>
capability is not supported in Vue 3 SFCs? Is there any workaround available? In my case, the HTML comments are being stripped out only in production mode, and I'm confused where the root cause of the behaviour lies; my webpack config, the internal behaviour of @vue/compiler-sfc, or just Vue 3 in general?
@JasperTey your case looks behaving this way because of this internal compiler bug: https://github.com/vuejs/vue-next/issues/3392