Skip to content
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

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

TheKonka
Copy link
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
Copy link

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).

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

@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 Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment