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

“Load project” takes too long #3166

Closed
DCLangX opened this issue Sep 30, 2021 · 4 comments
Closed

“Load project” takes too long #3166

DCLangX opened this issue Sep 30, 2021 · 4 comments
Milestone

Comments

@DCLangX
Copy link

DCLangX commented Sep 30, 2021

I have a root folder with many projects in it, including vue3, vue2, node, ts,

微信图片_20210930132403

when I open vscode, vetur will initialize and take 10 minutes to load all the projects in my folder

微信截图_20210930135346

微信图片_20210930132319

and then prompt me "Vetur can' t find tsconfig.json or jsconfig.json"

微信图片_20210930133553

I tried to add vetur.config.js so that it only loads one project to reduce the initialization time

微信图片_20210930135012
Vetur.config.js in the root folder:

module.exports = {
  settings: {
    'vetur.useWorkspaceDependencies': true,
    'vetur.experimental.templateInterpolationService': true
  },
  projects: [
    {
      root: './飞网',
      package: './package.json'
    }
  ]
}

Vetur.config.js in the project:

module.exports = {
  settings: {
    'vetur.useWorkspaceDependencies': true,
    'vetur.experimental.templateInterpolationService': true
  },
  projects: [
    {
      root: './',
      package: './package.json'
    }
  ]
}

But it didn't work , vetur still scanned the entire root directory.
I don't want to use the multi-root function of vscode.
How can I set up so that vetur only scans the project where the file I open is located instead of scanning the entire root directory?

@yoyo930021
Copy link
Member

yoyo930021 commented Oct 4, 2021

Vetur will pre-scan dependencies when init.
This feature can provide more performance when using dependencies.

Vetur only supports a vetur.config.js in a mono project.

@yoyo930021
Copy link
Member

If you don't need local dependencies in vetur, set vetur.useWorkspaceDependencies: false.

@DCLangX
Copy link
Author

DCLangX commented Oct 8, 2021

If you don't need local dependencies in vetur, set vetur.useWorkspaceDependencies: false.

使用工作区依赖
I tried to set false,but it doesn't seem to work.Maybe this problem can't be solved...:sob:

@yoyo930021
Copy link
Member

I find some bugs about this.

  1. Vetur find node_modules when vetur.useWorkspaceDependencies: false.
  2. Vetur don't load node_modules cache.

@yoyo930021 yoyo930021 added this to the v0.35.0 milestone Oct 12, 2021
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