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

Modifications in App.vue are not retained when typescript plugin is added to a CLI created project afterwards #3001

Open
ronaldborman opened this issue Nov 23, 2018 · 2 comments

Comments

@ronaldborman
Copy link

Version

3.0.3

Node and OS info

Node 8.9.4 / npm 5.6.0 / Windows 10

Steps to reproduce

  1. execute 'vue create vue-issue' and choose the default preset (babel, eslint);
  2. modify App.vue (for instance add a div to the template section);
  3. execute 'vue add @vue/typescript' (version 3.1.1) in the root of the 'vue-issue' folder. Don't use class-style component syntax but do use Babel alongside TypeScript.

What is expected?

App.vue still contains my modifications after adding the typescript plugin.

What is actually happening?

The modifications are not retained.

@LinusBorg
Copy link
Member

LinusBorg commented Nov 23, 2018

That won't really be feasible as we can't merge ts code into your js in a way that works afterwards.

Situations like these are the reason that we have a warning in the docs to commit everything before involving a plugin - then you can use the gif diffs to revert or merge anything that was changed in a way that it broke your code.

@ronaldborman
Copy link
Author

It looks like App.vue is replaced with the example template that is appropriate when you create a project but imho has less value when you already have a project. I think that when you apply a plugin afterwards you are more interested in the 'plumping' and less in the examples (at least I was). It would be nice if the plugin could differentiate between the two use cases (initial and afterwards install).

That said, I agree that this is not a bug and that the warning is sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants