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

Project baseURL should relative to tsconfig.json, not root #2952

Closed
4 tasks done
NateScarlet opened this issue May 27, 2021 · 0 comments
Closed
4 tasks done

Project baseURL should relative to tsconfig.json, not root #2952

NateScarlet opened this issue May 27, 2021 · 0 comments

Comments

@NateScarlet
Copy link

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Windows 7 7601
  • Vetur version: 0.33.1
  • VS Code version: 1.56.2

Problem

Tring to use vetur in a monorepo.

Vetur can not resolve module when tsconfig.json not placed in project root folder
image

Vetur seems think BaseURI in tsconfig.json is relative to project root, but actually it is relative to same folder as tsconfig.json
image

Reproducible Case

  1. Extract issue-repro-2021-05-27.zip
  2. cd project-1
  3. pnpm i or npm i
  4. Open project-1/src/App.vue
  5. See error

Workaround

set project root to tsconfig.json

--- a/vetur.config.js
+++ b/vetur.config.js
@@ -2,8 +2,8 @@
 module.exports = {
   projects: [
     {
-      root: "./project-1",
-      tsconfig: "./src/tsconfig.json",
+      root: "./project-1/src",
+      package: '../package.json'
     },
   ],
 };
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