vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Improve config file docs #2543

Open yoyo930021 opened 3 years ago

yoyo930021 commented 3 years ago

Feature Request

We have three config file.

We need to describe their previous relationships and roles.

chris-NR commented 3 years ago

I arrived at this issue after trying to figure out how to fix an 'incorrect' vetur project configuration. This was my experience:

  1. vetur extension seems to initialise OK when opening the workspace (no warnings or errors reported)

  2. two warnings pop up on opening a .vue file:

    • vetur can't find package.json
    • vetur can't find tsconfig.json or jsconfig.json
  3. I figured that as these files are a very important part of the app I should fix the issue....

  4. I already have package.json and jsconfig.json in my vue project but these are one folder below my 'project root' e.g. root/frontend/package.json not root/package.json so this must be the problem.....

  5. I looked at the docs and found the (very confusing) section on the vetur.config.js file and so I had a go at fixing it by creating the config file with the 'vetur root' one level down. The 'monorepo / projects' section confused me as I don't know what a monorepo is so I left that section out and just set the default root

    vetur
  6. Unfortunately this did not work and I can't figure out why from the docs

  7. I have found the option to disable the warning in the vetur settings however I have no idea what an 'incorrectly setup' project means or whether this is a good or bad thing to do!

  8. I finally managed to fix it by trial and error, this is the working vetur.config.js file

    vetur2
chris-NR commented 3 years ago

I have also learnt what a monorepo is and I do indeed have a monorepo containing my backend node.js code and my frontend vue.js code