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(plugin-inject): 修复 inject 插件配置新增 componentsMap 时, 编译解析 export 导出失败问题 #14520

Closed
wants to merge 2 commits into from

Conversation

beezen
Copy link
Contributor

@beezen beezen commented Sep 11, 2023

这个 PR 做了什么? (简要描述所做更改)
背景:Taro v3.6.16,Vue2 配置了 plugin-inject 插件 componentsMap 信息时,npm run build:weapp 编译失败。
image

目的:修复 inject 插件配置,新增 componentsMap 时,编译解析 export 导出失败的问题。

备注:在这一次 #13306 修改中,禁用了 providedExports 配置。但从逻辑上应该启用 providedExports 配置才对,可帮忙再次确认一下。

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

  • 错误修复(Bugfix) issue: fix #
  • 新功能(Feature)
  • 代码重构(Refactor)
  • TypeScript 类型定义修改(Typings)
  • 文档修改(Docs)
  • 代码风格更新(Code style update)
  • 其他,请描述(Other, please describe):

这个 PR 涉及以下平台:

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

@taro-bot2
Copy link

taro-bot2 bot commented Sep 11, 2023

欢迎提交 PR~ Taro 非常感谢您对开源事业做出的贡献!🌷🌷🌷

一般 PR 会在一到两周内进行 review,成功合入后会随下一个版本进行发布。

Review 需要耗费大量时间,所以请遵循以下规范,协助我们提高 review 效率🙏🙏🙏

  1. 详细介绍 PR 的背景(非常重要,例如解决了什么问题,该问题如何复现等)
  2. 确保 CI 顺利运行。
  3. 最好能提供对应的测试用例。

为了更好地进行沟通,请加入 Taro 开发者微信群:

@beezen
Copy link
Contributor Author

beezen commented Sep 18, 2023

@Chen-jj 这个问题有没有人帮忙看看 不然配置了 componentsMap 后,就不能在生产环境编译了

@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 26, 2023

@beezen 这样直接改回去还是会存在 #13299 的问题,为了根治这个问题同时不改变 treeshake 的行为,我在 #14607 中使用 esbuild 提前对 plugin-inject 的 components/react 文件进行 bundle,这样 Webpack 编译时不会因为 export * from 语法而出现错误。

因此这个 PR 先关闭了哈

@Chen-jj Chen-jj closed this Sep 26, 2023
Chen-jj added a commit that referenced this pull request Oct 31, 2023
…14607)

* fix(plugin-inject): 修复 Vue2 使用 componentsMap 配置时报错的问题,#13299 #14520

* fix(plugin-inject): 开启 treeshake

---------

Co-authored-by: xuanzebin <38971117+xuanzebin@users.noreply.github.com>
moseszhou added a commit to moseszhou/taro that referenced this pull request Nov 1, 2023
* next:
  fix: 修复babel-plugin-transform-taroapi插件对canIUse入参scheme处理问题 (NervJS#14717)
  feat: deriveDataFromProps逻辑抽离到/plugin-platform-alipay
  fix(alipay): support root-portal component (NervJS#14171)
  fix(plugin-inject): 修复 Vue2 使用 componentsMap 配置时报错的问题,NervJS#13299 NervJS#14520 (NervJS#14607)
  fix(weapp): `Map` attribute replenishment
  refactor(types): sync components types
  fix(weapp): `LivePlayer` attribute replenishment (NervJS#14668)
  fix(tt): `Input` attribute replenishment
  types: 根据文档补充配置 enableSourceMap 类型
  fix(weapp): 完善微信小程序视频号相关组件的属性实现,fix NervJS#14608
  chore: 添加提示文案
  fix: 支付宝渲染问题, 当页面复杂,CustomWrapper和page都有数据更新时,CustomWrapper的UI有几率出现不更新的情况
  Revert "perf: rn端sass文件引入路径包含别名时支持~,例如: @import ’~@/common/baseStyle.scss‘"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants