
vite.config.ts 配置 alias:
resolve: { alias: { '@': path.resolve(__dirname, './src') } }, 使用时可以找到文件,但 vscode 的 Vetur 会报如下错误:
Cannot find module '@/xxx' or its corresponding type declarations.Vetur(2307)
如何让它不报错并且可以在代码提示时自动使用 alias 呢?
1 dewfall 2021-03-08 14:20:59 +08:00 ts 的话可以配置 compilerOptions.paths |
2 zhuweiyou 2021-03-08 15:25:22 +08:00 js 的话 也可以 jsconfig.json, 配置同楼上 |