Missing "./preload-helper" export in "vite" package搜索 vite/preload-helper 替换为 \0vite/preload-helper
ls-remote -h -t git://github.com/adobe-webplatform/eve.gitgit config --global url."https://github.com/".insteadOf "ssh://git@github.com/"
git config --global url."https://hub.fastgit.xyz/".insteadOf "ssh://git@github.com/"
在 tsconfig.json 中添加 "types": ["vite/client"]
{
"compilerOptions": {
"types": ["vite/client"]
}
}
在 tsconfig.json 中添加 "jsx": "preserve" 和 "jsxImportSource": "vue"
{
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "vue"
}
}
Starting in Vue 3.4, Vue no longer implicitly registers the global JSX namespace,从 Vue 3.4 开始,Vue 不再隐式注册全局 JSX 命名空间
在 vite.config.ts 中添加:
export default defineConfig({
// ...
build: {
target: 'esnext', // you can also use 'es2020' here
},
optimizeDeps: {
esbuildOptions: {
target: 'esnext', // you can also use 'es2020' here
},
},
})
另外,请确保你的 Typescript 目标足够高:
{
"compilerOptions": {
"target": "ES2020" // you can also use higher value
// ...
}
}