0

我已禁用所有 vscode 扩展。

这是我的 jsconfig 配置:

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

这是我的项目目录结构

├── script
│   ├── gulp
│   │   ├── task
│   │   │   ├── components
│   │   │   │   └── index.js
│   │   │   └── ...
│   │   └── ...
│   │
│   ├── utils
│   │   ├── yaml.js <-- I expect the automatic import behavior in this file
│   │   └── ...
│   └── ...
│
├── src
│   ├── app.js <-- I don't expect the automatic import behavior in this file
│   └── ...
│
├── jsconfig.json
├── gulpfile.babel.js
└── ...

当我在脚本目录中使用自动导入时(我想要的行为)

https://i.stack.imgur.com/HudET.gif

当我在 src 目录中使用自动导入时(我不想要的行为)

https://i.stack.imgur.com/XZX76.gif

我不知道我配置错了什么或其他错误

有人可以帮助我吗?

4

0 回答 0