We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在项目开发中我们会在 webpack 使用别名 alias 配置如:
webpack
alias
alias: { "@globalCss": path.join(__dirname, "/src/assets/style/common"), "@util": path.join(__dirname, "/src/utils"), "@assets": path.join(__dirname, "/src/assets"), "@": path.join(__dirname, "/src") }
方便我们引用不需要知道其详细路径,但会影响 VS Code 查找文件,使无法通过 Command 键 + 鼠标点击直接跳转到对应的文件:
VS Code
Command
VS Code对相对路径的引用有很友好的操作,如 import { moduleAccessRecord } from '../../../redux/actions/commonData'
VS Code对相对路径的引用有很友好的操作,如
import { moduleAccessRecord } from '../../../redux/actions/commonData'
import styles from "@/assets/style/BulletinManage/index.less"; import Footer from "@/components/footer";
发现 VS Code 提供 jsconfig.json 文件指定了根文件为 JavaScript 语言服务提供的功能的选项,通过如下配置就可以解决查找问题:
jsconfig.json
JavaScript
如果是 ts 路径查找,需要配置 tsconfig.json
tsconfig.json
{ "compilerOptions": { "baseUrl": "./", "paths": { "@/*": ["src/*"], "@util/*": ["src/utils/*"], "@assets/*": ["src/assets/*"] } }, "exclude": ["node_modules", "dist"] }
VS Code jsconfig.json
The text was updated successfully, but these errors were encountered:
不行,重启vscode还是不行
Sorry, something went wrong.
No branches or pull requests
在项目开发中我们会在
webpack
使用别名alias
配置如:方便我们引用不需要知道其详细路径,但会影响
VS Code
查找文件,使无法通过Command
键 + 鼠标点击直接跳转到对应的文件:发现
VS Code
提供jsconfig.json
文件指定了根文件为JavaScript
语言服务提供的功能的选项,通过如下配置就可以解决查找问题:VS Code jsconfig.json
The text was updated successfully, but these errors were encountered: