data-set icon indicating copy to clipboard operation
data-set copied to clipboard

@antv/data-set打包后文件过大如何解决

Open lynnReno1994 opened this issue 3 years ago • 8 comments

每次打包都会提示[BABEL] Note: The code generator has deoptimised the styling of /Users/lynn/workspace/DeepBlue/DBG_AD/AdvertWEB/web_monitor/node_modules/_@[email protected]@@antv/data-set/build/data-set.js as it exceeds the max of 500KB.

请问有什么好的解决办法么 ?

  • Link:

  • Platform:

  • Mini Showcase(like screenshots):

lynnReno1994 avatar Dec 15 '20 09:12 lynnReno1994

同样556k

zhangfangbiao avatar Dec 23 '20 06:12 zhangfangbiao

实际是730k

flyingcrp avatar Mar 16 '21 03:03 flyingcrp

目前 data-set 的代码组织方式,没法发挥 webpack 的按需打包优势,只能重构,重新组织才行。

是否有愿意来搞起这个事情的同学?

hustcc avatar Mar 16 '21 05:03 hustcc

多处引用,累计太大

caoxuccc avatar May 06 '21 07:05 caoxuccc

没有cdn吗?

GTuooa avatar Nov 05 '21 03:11 GTuooa

source-map-explorer 分析得 默认依赖文件 node_modules/@antv/data-set/build/data-set.js 占用 618.37kb. 该文件未压缩。

可以尝试:

// import DataSet from '@antv/data-set'
import DataSet from '@antv/data-set/lib'

这么使用后我这边降到了 56.79kb

xyy94813 avatar Jan 04 '22 09:01 xyy94813

同问有CDN或者什么方式压缩体积吗

ufoozhenghao avatar Feb 28 '22 00:02 ufoozhenghao

我的情况: 我只用到少数几个 transform, 其实就是几个工具函数, 但是却安装了全家桶 660kb 有大佬有空把这些 tranform 单独提取出来作为一个单独的包发布吗? 有的话请艾特我

vaynevayne avatar Oct 31 '23 09:10 vaynevayne