-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在和自动导入插件同时使用时的问题优化 #21
Comments
我按这种方式修改之后,打包后,unplugin-auto-import 自动导入还是有问题,还有没有其他解决方案 |
解决了,vite打包的时候,自动导入应该使用'unplugin-auto-import/rollup' `import AutoImportVite from 'unplugin-auto-import/vite'; // cdn链接 |
这样配置之后打包的时候还是没有自动引入,你用的哪个版本啊 |
当我在项目中同时使用到了
unplugin-auto-import
自动导入相关API
时, 打包的时候会因为vite-plugin-externals
先进行外部库的处理转换,而导致unplugin-auto-import
自动导入的API
失效。下面是我查看的使用自动导入
ref
时插件的执行顺序。然后我在
node_modules
下面修改了vite-plugin-externals
的index.js
中关于该插件的返回对象(添加了属性enforce: 'post'
)后就可以正常使用了。希望老哥看下有没有更好的处理方法优化一下。
The text was updated successfully, but these errors were encountered: