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

vue-template-compiler line number #8665

Closed
fleksin opened this issue Aug 16, 2018 · 2 comments
Closed

vue-template-compiler line number #8665

fleksin opened this issue Aug 16, 2018 · 2 comments

Comments

@fleksin
Copy link

fleksin commented Aug 16, 2018

What problem does this feature solve?

Recently I am trying to write a webpack loader for vue component, during which I came across the package vue-template-compiler.
It works perfectly except that it doesn't have any location info in the ast.

I read something here:

http://echizen.github.io/tech/2017/10-29-vue2wx

It's in Chinese, but you can see the ast result from the compiler method has "originLine" to indicate position.
But When I tried it I didn't get the "originLine", link:

https://runkit.com/fleksin/5b754fd8f424830012365766

So I am not sure if it's already a feature or is it removed from 2.5.17, or am I missing something in the options ?
btw, the version of vue-template-compiler I'm using is 2.5.17.
Some general direction would be much apprieciated.
Thanks in advance :)

What does the proposed API look like?

return ast like this:

{
   ast:   {
      ...
     originLine: xx,
   }
}

@posva
Copy link
Member

posva commented Aug 16, 2018

Duplicate of #6338, PR at #7127

@posva posva marked this as a duplicate of #7127 Aug 16, 2018
@posva posva closed this as completed Aug 16, 2018
@fleksin
Copy link
Author

fleksin commented Aug 16, 2018

Thanks! :)

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

No branches or pull requests

2 participants