[vite] Dynamic require of “path“ is not supported

当引入path时报 Dynamic require of “path” is not supported 错误

错误代码:

解决:

查看 vite的版本可能不支持commonJS,所以要改为 import { } from ' ' 就可以了

vite.config.ts

猜你喜欢

转载自blog.csdn.net/weixin_46413834/article/details/128896524
今日推荐