vbenjs / vite-plugin-mock

A mock plugin for vite.use mockjs.
MIT License
610 stars 96 forks source link

是否支持vite5 #124

Closed wzs28150 closed 8 months ago

wzs28150 commented 8 months ago

再vite5中使用启动会有警告,开启VITE_CJS_TRACE=true后追踪到这个插件,请问该插件是否支持vite5?image

haiweilian commented 8 months ago

最新 3.0.1 支持。你应该添加 "type": "module" 因为现有的插件基本都兼容 vite2-5 ,默认加载的都是 cjs。

这个警告解决方案详见:https://cn.vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated

wzs28150 commented 8 months ago

升级到3.0.1正常了 感谢~

shaojiankui commented 7 months ago
VueDevTools(),

No overload matches this call. The last overload gave the following error. Type 'Plugin' is not assignable to type 'PluginOption'. Type 'import("/Users/jakey/Desktop/vue/node_modules/_vite@5.0.12@vite/dist/node/index").Plugin' is not assignable to type 'import("/Users/jakey/Desktop/vue/node_modules/vite/dist/node/index").Plugin'. Types of property 'apply' are incompatible. Type '"serve" | "build" | ((this: void, config: import("/Users/jakey/Desktop/vue/node_modules/_vite@5.0.12@vite/dist/node/index").UserConfig, env: import("/Users/jakey/Desktop

我为啥报这个