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

vscode项目alias设置:2020-5-13 #21

Open
jsonz1993 opened this issue Jul 27, 2021 · 0 comments
Open

vscode项目alias设置:2020-5-13 #21

jsonz1993 opened this issue Jul 27, 2021 · 0 comments

Comments

@jsonz1993
Copy link
Owner

本文为博客迁移过来,原文链接: vscode项目alias设置:2020-5-13

一般我们在会在webpack配alias,比如 { '@': path.resolve(__diranme, './src') }

如果在项目上直接这么写,vscode是跳不到目标文件,比如import router from '@/router'

所以可以在vscode上加一个配置用来让vscode识别这些。

如果项目上用的是 ts ,则配 tsconfig.json,js 则在项目根目录上新建 jsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "exclude": ["node_modules"]
}

更多配置看官网

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

1 participant