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

h5 optimization中 开启 treeShaking 编译会删除使用到的组件 #841

Closed
hxzAugustinus opened this issue Sep 30, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@hxzAugustinus
Copy link

问题描述
当启动h5的treeShaking时,编译结果会删除一些我使用到的组件

复现步骤
在 manifest.json 中配置如下

{
  "h5": {
    "title": "xxx",
    "router": {
      "mode": "history",
      "base": ""
    },
    "optimization": {
      "treeShaking": {
        "enable": true
      }
    },
    "domain": "https://xxx.cn"
  }
}

开发环境编译运行截图
development

生产环境编译运行截图
production-onshake

可以看到编译把picker 和 actionsheet 给删除了,但我确定在非首页使用到大量的picker ,当我
在 manifest.json中移除treeShaking,又恢复正常了

预期结果
treeShaking开启后 picker正常使用

实际结果
treeShaking开启后 picker无法使用

系统信息:

  • 发行平台: H5平台
  • HBuilderX版本 2.3.3.20190923
@zhetengbiji zhetengbiji self-assigned this Sep 30, 2019
@zhetengbiji zhetengbiji added the bug Something isn't working label Sep 30, 2019
@LIJUN-XU
Copy link

LIJUN-XU commented Jan 3, 2023

h5 的配置 里面有domain ,在文档中没有看到。请问在哪里能查到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants