-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
taro@2.0.5如何将echart.js文件分离出公共组件(common.js),并在子包中引用 #5628
Comments
CC @luckyadam |
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
不用抽,直接copy |
@conkyliu 怎么操作 |
再把文件copy到相应位置 |
Duplicate of #5645 |
@Super-Bin 你好:heart: 你现在处理方案是copy 还是使用分包拆离:smile: |
现在是拆包,可以看这个 #5645 |
@Super-Bin 非常感谢🙏🙏🙏 |
问题描述
图表库引入问题。引入了echart.js文件,造成主包体积超过2M,现在想把echart相关组件和库放进子包,减少主包体积。但taro打包会自动把子包中的库合并进common.js文件,造成主包过大。按照文档配置webpack,并没有效果。
app.tsx配置路径,主包中的pages/home/index,就一个按钮,跳转到子包中的pages/index/index,在子包中使用图表库
期望行为
希望能把echart.js比较大的库,从common.js中分离,并且放入子包模块中。能正确被引用
报错信息
主包common.js中依然引用了echart.js文件

系统信息
Taro CLI 2.0.5 environment info:
System:
OS: macOS 10.15.3
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.17.3 - ~/.nvm/versions/node/v10.16.0/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
npmPackages:
@tarojs/components: 2.0.5 => 2.0.5
@tarojs/components-qa: 2.0.5 => 2.0.5
@tarojs/mini-runner: 2.0.5 => 2.0.5
@tarojs/redux: 2.0.5 => 2.0.5
@tarojs/redux-h5: 2.0.5 => 2.0.5
@tarojs/router: 2.0.5 => 2.0.5
@tarojs/taro: 2.0.5 => 2.0.5
@tarojs/taro-alipay: 2.0.5 => 2.0.5
@tarojs/taro-h5: 2.0.5 => 2.0.5
@tarojs/taro-qq: 2.0.5 => 2.0.5
@tarojs/taro-quickapp: 2.0.5 => 2.0.5
@tarojs/taro-swan: 2.0.5 => 2.0.5
@tarojs/taro-tt: 2.0.5 => 2.0.5
@tarojs/taro-weapp: 2.0.5 => 2.0.5
@tarojs/webpack-runner: 2.0.5 => 2.0.5
eslint-config-taro: 2.0.5 => 2.0.5
eslint-plugin-taro: 2.0.5 => 2.0.5
nerv-devtools: ^1.5.6 => 1.5.6
nervjs: ^1.5.6 => 1.5.6
stylelint-config-taro-rn: 2.0.5 => 2.0.5
stylelint-taro-rn: 2.0.5 => 2.0.5
补充信息
在微信群问了好几遍,也没有得到回复。希望能给出解决方
子包代码附件
subPackage.zip
The text was updated successfully, but these errors were encountered: