babel-runtime make bundle more large when works with webpack@1
relative issue: https://github.com/babel/babel-loader/issues/231
rc-component should not use babel-runtime?
cc @yiminghe
ref https://github.com/ant-design/ant-design-mobile/issues/1565
@ustccjw 我这个 https://unpkg.com/[email protected]/dist/rc-gesture.js 没发现 babel-runtime 的冗余代码,只插入了必要的
@paranoidjk [email protected] 没使用 babel-runtime 和最新版本可以做比较,不一定是引入冗余代码,只是 core-js 导致体积变大
test with rc-gesture
npm run dist --babel-runtime
generated rc-gesture.js 69.87kB generated rc-gesture.js.map 89.58kB generated rc-gesture.min.js 23.67kB
npm run dist
generated rc-gesture.js 23.25kB generated rc-gesture.js.map 21.93kB generated rc-gesture.min.js 7.29kB
@paranoidjk 你这个估计模块很少,所以看起来特别显著。不过移动端的项目一般 bundle 不会太大,所以还是有影响的。


helper 冗余了一份, https://babeljs.io/docs/plugins/transform-runtime/#optionshelpers
webpack and babel are effectively broken together because of the babel-runtime issue mentioned above. I suggest trying with the TypeScript compiler instead. I was able to get better output there.