Skip to content

fix(vite): fix h5 build error when use vite#16256

Open
TheKonka wants to merge 7 commits intoNervJS:mainfrom
TheKonka:fix/h5
Open

fix(vite): fix h5 build error when use vite#16256
TheKonka wants to merge 7 commits intoNervJS:mainfrom
TheKonka:fix/h5

Conversation

@TheKonka
Copy link
Copy Markdown
Member

@TheKonka TheKonka commented Aug 4, 2024

这个 PR 做了什么? (简要描述所做更改)

  • 修复window使用vite打包H5报错问题
  • 修复vite打包时, 通过 taro.API 使用 @tarojs/taro-h5 中的 api 报错问题
  • 修复 使用 webpack 打包, Taro.options.html 是 undefined的问题
  • 当初始化项目选择vite时,添加 vitePlugins 字段到编译配置
  • 修改typescript 定义文件中 entityIds 和tmplIds 属性为可选,添加wx.getApiCategory ,wx.onApiCategoryChangewx.offApiCategoryChange 3个API,showModal添加editable和content类型,添加编译配置中min.prerender的类型

这个 PR 是什么类型? (至少选择一个)

这个 PR 涉及以下平台:

  • 所有小程序
  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 字节跳动小程序
  • QQ 轻应用
  • 京东小程序
  • 快应用平台(QuickApp)
  • Web 平台(H5)
  • 移动端(React-Native)
  • 鸿蒙(harmony)

- fix vite build h5 error, mostly due to different separators on window
- fix h5 cannot use Taro.API when use vite
- fix Taro.options.html not mounted when use webpack
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 4, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.51%. Comparing base (1ed101a) to head (c26ada8).
⚠️ Report is 357 commits behind head on main.

❌ Your project check has failed because the head coverage (58.51%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16256   +/-   ##
=======================================
  Coverage   58.51%   58.51%           
=======================================
  Files         466      466           
  Lines       27109    27113    +4     
  Branches     5894     5935   +41     
=======================================
+ Hits        15862    15866    +4     
+ Misses       9900     9896    -4     
- Partials     1347     1351    +4     
Flag Coverage Δ
taro-cli 73.67% <ø> (ø)
taro-runtime 59.83% <ø> (ø)
taro-web 52.72% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/taro-h5/src/api/base/weapp/life-cycle.ts 100.00% <100.00%> (ø)

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TheKonka TheKonka linked an issue Aug 4, 2024 that may be closed by this pull request
This was referenced Aug 10, 2024
This was referenced Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant