umi3.1.1使用esbuild编译压缩后,大小并没有任何变化

Created on 11 May 2020  ·  7Comments  ·  Source: umijs/umi

What happens?

2020.5.9 大神 分享了 彻底告别编译 OOM,用 esbuild 做压缩器一文,迫不及待尝试了下。
按要求引用了依赖插件 yarn add @umijs/plugin-esbuild,同时在.umirc.ts中开启了esbuild。
进行编译后,对比之前dist包文件大小没有任何改变,是我哪里没设置对吗?

.umirc.ts 配置如下:

import { defineConfig } from 'umi';
export default defineConfig({
nodeModulesTransform: {
type: 'none'
},
esbuild: {},
dynamicImport:{},
title:'',
locale: { antd: true }
});

package.json 配置环境已引用"@umijs/plugin-esbuild": "^1.0.0-beta.2"

使用 npm run build 打包

相关环境信息

  • Umi 版本:3.1.1
  • Node 版本:v12.16.2
  • 操作系统:win10

Most helpful comment

编译时间变得更长了,晕了

All 7 comments

这个只是加速压缩,不是改变大小。

image
官方文章有提到压缩测试,这个又是什么意思,还是我理解有误吗

这个只是加速编译,不是改变大小。

这图最主要的数据应该是内存消耗把,看尺寸没变化

这图最主要的数据应该是内存消耗把,看尺寸没变化
尺寸和 gzipped 都变小了哦,不过还是感谢回答,要是真的只增加编译速度,感觉解决不了实际作用,就是希望编译压缩后,在用户访问时请求的文件越小越好 哎···

只解决编译速度问题,缺点是 gzipped 后的尺寸会增大 10% 左右。

只解决编译速度问题,缺点是 gzipped 后的尺寸会增大 10% 左右。
谢谢大佬

编译时间变得更长了,晕了

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tangzhengwen picture tangzhengwen  ·  4Comments

sorrycc picture sorrycc  ·  4Comments

Artoria-0x04 picture Artoria-0x04  ·  3Comments

RunningCoderLee picture RunningCoderLee  ·  3Comments

nguyenhuutinh picture nguyenhuutinh  ·  3Comments