-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
A comments
flag to keep all comments in the parse function
#1853
Comments
The condition would be replaced by } else if (!__DEV__ && node.type === NodeTypes.COMMENT && !comments) { |
For reference here is the original issue. |
Yeah, open to a PR |
elevatebart
changed the title
A
A Aug 14, 2020
comment
flag for the parse functioncomments
flag to keep all comments in the parse function
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What problem does this feature solve?
When using
@vue/component-core
'sparse()
function while building an application for production, all html comments are lost.In vue-docgen-api, I use the comments to determine information about the component. Even if I don't package the component entirely with its comments they are useful at build time when the NODE_ENV is set to 'production'.
What does the proposed API look like?
Add a
comments
option to theParseOptions
false by default in prod, useless (and considered true) in dev that would override line 231 orparse.ts
https://github.com/vuejs/vue-next/blob/ac81dcf0cc7f5fc722a0c14d1cc92ece5cc0db07/packages/compiler-core/src/parse.ts#L231-L235
Usage:
Without the perf cost of having the comments all the time, we would still be able to extract them optionally.
I could make a PR if need be.
The text was updated successfully, but these errors were encountered: