Skip to content

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

Open
@ronaldborman

Description

@ronaldborman

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.

Activity

LinusBorg

LinusBorg commented on Nov 23, 2018

@LinusBorg
Member

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

ronaldborman commented on Nov 23, 2018

@ronaldborman
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ronaldborman@LinusBorg

        Issue actions

          Modifications in App.vue are not retained when typescript plugin is added to a CLI created project afterwards · Issue #3001 · vuejs/vue-cli