1***@qq.com
1***@qq.com
  • 发布:2023-05-17 18:16
  • 更新:2024-01-30 14:37
  • 阅读:338

vite+vue3创建的项目,package.json里配置"type": "module"后,再pnpm dev:mp-wexin就报“uni is not a function”

分类:uni-app
2023-05-17 18:16 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者) - like

不限于dev:mp-wexin,dev:h5也是

yingpop

yingpop

有解决么

EthanZhong

EthanZhong - coding

import { type Plugin, defineConfig } from 'vite';  
import type { VitePluginUniOptions } from '@dcloudio/vite-plugin-uni';  
import * as uni from '@dcloudio/vite-plugin-uni';  
const uniPlugin = (uni.default as any).default as (  
  rawOptions?: VitePluginUniOptions  
) => Plugin[];  
// https://vitejs.dev/config/  
export default defineConfig({  
  plugins: [uniPlugin()],  
});  

要回复问题请先登录注册