Replies: 3 comments 5 replies
-
看生产优化 这简单提了一下,是因为采用了 “内置的压缩器对 JavaScript 和 CSS 代码进行压缩” 吗 ?这个体积压缩效果很显著 |
Beta Was this translation helpful? Give feedback.
2 replies
-
Rspack 压缩默认使用 SWC minifier,他和 Terser 的压缩率接近,有的时候 SWC minifier会更优秀一点,但不会相差很多。 对于提到的 babel regenerator runtime 和胶水(helper)代码,在同样需要语法降级的前提下的话,我们也会有 SWC 的 regenerator runtime 和 swc helper 的代码,总的来说体积应该是比较接近的,这里可以通过 splitChunks 把 helper 单独打一个 chunk 来优化。 体积方面我们还没有超越 Webpack |
Beta Was this translation helpful? Give feedback.
3 replies
-
我测试的结果是rspack体积会大2%左右 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
看SWC的介绍,SWC压缩算法是不如babel的,体积会大2%左右。
但是在我用analyze分析了rspack的产物、和 webpack的产物后,我发现rspack的产物比webpack的要小上很多。
我自己对比构建后的代码发现可能是以下原因:
这个是会重复打包进入的,只要有多个bundle那么就会打包多份
除此之外,是否rspack还用了更高明的方法来处理React 、tsx文件 ??


Beta Was this translation helpful? Give feedback.
All reactions