只要是@开头的路径都识别不了,vite+typescript,Could not find a declaration file for module “@/xxx",哪位大神知道tsconfig.js该如何配置? #13089
Unanswered
tiktwink
asked this question in
Help/Questions
Replies: 2 comments
-
import path from 'node:path'
export default defineConfig(({ command, mode }) => {
const srcPath = path.resolve(__dirname, 'src')
return {
resolve: {
alias: [
// @ -> src
{ find: '@', replacement: srcPath },
// less 中 ~
{ find: /^~/, replacement: '' }
]
},
}
}) 当然,偶尔也会出现 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
哪位大神知道tsconfig.js该如何配置?
Beta Was this translation helpful? Give feedback.
All reactions