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

babel-runtime make bundle more large when works with webpack@1 #37

Open
ustccjw opened this issue Jul 25, 2017 · 8 comments
Open

babel-runtime make bundle more large when works with webpack@1 #37

ustccjw opened this issue Jul 25, 2017 · 8 comments
Labels

Comments

@ustccjw
Copy link

ustccjw commented Jul 25, 2017

relative issue: babel/babel-loader#231

rc-component should not use babel-runtime?

@ustccjw
Copy link
Author

ustccjw commented Jul 25, 2017

cc @yiminghe

@paranoidjk
Copy link
Member

@paranoidjk
Copy link
Member

@ustccjw 我这个 https://unpkg.com/rc-gesture@0.0.3/dist/rc-gesture.js 没发现 babel-runtime 的冗余代码,只插入了必要的

@ustccjw
Copy link
Author

ustccjw commented Jul 25, 2017

@paranoidjk rc-animate@2.3.6 没使用 babel-runtime 和最新版本可以做比较,不一定是引入冗余代码,只是 core-js 导致体积变大

@paranoidjk
Copy link
Member

paranoidjk commented Jul 25, 2017

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

@ustccjw
Copy link
Author

ustccjw commented Jul 25, 2017

@paranoidjk 你这个估计模块很少,所以看起来特别显著。不过移动端的项目一般 bundle 不会太大,所以还是有影响的。

@paranoidjk
Copy link
Member

paranoidjk commented Jul 25, 2017

@lookfirst
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants