
获得徽章 9
- vite使用tspath,需要添加插件:
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
plugins: [tsconfigPaths()],
})展开评论点赞 - 编译错误:Cannot find name 'window'
解决办法:
tsconfig.json 的 lib加dom,比如:
"compilerOptions": {
"lib": ["es5", "es6", "dom"],评论点赞 - 运行命令:pnpm install turbo --global 时出现错误:Run "pnpm setup" to create it automatically, or set the global-bin-dir setting, or the PNPM_HOME env variable. The global bin directory should be in the PATH.
解决方法:
pnpm setup
记得重启终端展开评论点赞