-
-
Notifications
You must be signed in to change notification settings - Fork 903
[optimize] JS bundle so big when add bindingx . #191
Comments
oh, many components has imported |
Thank you for your feedback. We have optimized today. |
oh,My carelessness Update weex-ui to |
@tw93 Thank you very much, It's a lot smaller. About Sometimes, I really just need import { parse } from 'bindingx-parser'
import _cloneDeep from 'lodash/cloneDeep'
const WeexBinding = weex.requireModule('bindingx')
const BindingxFunction = WeexBinding.bind
let _WeexBinding = _cloneDeep(WeexBinding)
// 重写 bind 方法
_WeexBinding.bind = (options, callback) => {
if (!options) {
throw new Error('should pass options for binding')
}
options.exitExpression = formatExpression(options.exitExpression)
if (options.props) {
options.props.forEach((prop) => {
prop.expression = formatExpression(prop.expression)
})
}
return BindingxFunction(options, options && options.eventType === 'timing' ? fixCallback(callback) : callback)
}
module.export = _WeexBinding |
@PerseveranceZ thank you for your advice. |
@huxiaoqi567 @tw93 Perfect! thanks very much. |
In addition, you can upgrade |
@tw93 Cooool~ Finally JS bundle size:@tw93 @huxiaoqi567 thanks for your help! |
1.Your development environment(weex、weex-toolkit、system and more).
2.Expected behavior and actual behavior.
I want to know why my js bundles so big and how to optimize. Thanks.
3.Steps to reproduce the problem.
when i use
weex-ui
withoutbindingx
, compiled js bundle info:when i use
[email protected]
withweex-bindingx
, compiled js bundle info:docs it work in
weex-ui
withoutweex-bindingx
.The text was updated successfully, but these errors were encountered: