当引入path时报 Dynamic require of “path” is not supported 错误
错误代码:
![](https://i-blog.csdnimg.cn/blog_migrate/6a7064c0cc9bf433fa8a8c54fa840bc7.png)
解决:
查看 vite的版本可能不支持commonJS,所以要改为 import { } from ' ' 就可以了
vite.config.ts
![](https://i-blog.csdnimg.cn/blog_migrate/666b4322807415ef75b872b19e2e76f5.png)
当引入path时报 Dynamic require of “path” is not supported 错误
错误代码:
解决:
查看 vite的版本可能不支持commonJS,所以要改为 import { } from ' ' 就可以了
vite.config.ts