Open PurpleNoon opened 4 months ago
使用 vite-ts 模板构建,添加 @vitejs/plugin-legacy 插件后,无法构建微信小程序(h5 的可以正常构建),由于报错时没有给出详细的错误信息输出,无法确定问题出在哪里 错误信息输出如下:
> uni-preset-vue@0.0.0 build:mp-weixin E:\qge\proj\other\uniapp-ts\legacy-test > uni build -p mp-weixin 正在编译中... uni-app 有新版本发布,请执行 `npx @dcloudio/uvm@latest` 更新,更新日志详见:https://download1.dcloud.net.cn/hbuilderx/changelog/4.15.2024050802.html Build failed with errors. ELIFECYCLE Command failed with exit code 1.
项目信息:
复现项目地址:https://github.com/PurpleNoon/uni-ts-legacy-plugin
完整复现步骤
npx degit dcloudio/uni-preset-vue#vite-ts my-vue3-project cd ./my-vue3-project pnpm i
pnpm i -D @vitejs/plugin-legacy
// vite.config.ts import { defineConfig } from "vite"; import uni from "@dcloudio/vite-plugin-uni"; import legacy from '@vitejs/plugin-legacy'
// https://vitejs.dev/config/ export default defineConfig({ plugins: [ uni(), legacy(), ], });
4. 执行 `pnpm run build:mp-weixin` 即可复现
补充: 操作系统:Win10
使用 vite-ts 模板构建,添加 @vitejs/plugin-legacy 插件后,无法构建微信小程序(h5 的可以正常构建),由于报错时没有给出详细的错误信息输出,无法确定问题出在哪里 错误信息输出如下:
项目信息:
复现项目地址:https://github.com/PurpleNoon/uni-ts-legacy-plugin
完整复现步骤
// https://vitejs.dev/config/ export default defineConfig({ plugins: [ uni(), legacy(), ], });