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

feat: add plugin-esbuild #3362

Merged
merged 2 commits into from
Aug 3, 2020
Merged

feat: add plugin-esbuild #3362

merged 2 commits into from
Aug 3, 2020

Conversation

LanceZhu
Copy link
Collaborator

@chenbin92
Copy link
Collaborator

PR 需要描述下这个插件的作用。使用这个插件在开发和构建分别能提速多少。安装这个插件会对应的执行这个 install 文件,下载会有问题吗 https://unpkg.com/browse/esbuild@0.6.5/install.js

@LanceZhu
Copy link
Collaborator Author

使用说明

  1. 安装插件

    $ npm install build-plugin-esbuild
  2. 编辑 build.json 启用 plugin-esbuild 插件。

    // build.json
    {
        "plugins": [
            "build-plugin-esbuild"
        ]
    }

esbuild 安装问题

安装这个插件会对应的执行这个 install 文件,下载会有问题吗 unpkg.com/browse/esbuild@0.6.5/install.js

我安装时遇到无法通过 npm 官方 registry 下载 esbuilld,新版本 esbuild@0.6.6 支持修改 registry。

@LanceZhu

This comment has been minimized.

@chenbin92 chenbin92 requested a review from ClarkXia July 27, 2020 13:03
@chenbin92
Copy link
Collaborator

根据速度变化数据得出,使用 esbuild 后,各示例 build 时间均稍有增加。 esbuild 未对构建速度有提升。

数据有增加的原因是否有排查,据 esbuild 官方的描述,构建是比 webpack 快会很多的,以及内存的占用情况。详见

image

@chenbin92
Copy link
Collaborator

@LanceZhu
Copy link
Collaborator Author

LanceZhu commented Aug 3, 2020

esbuild 优化效果

实验对象

hello-world,fusion-design-pro-ts, fusion-design-lite-ts

实验方法

使用 esbuild-webpack-plugin 引入 esbuild

esbuild 替换 icejsterser-webpack-plugin 。记录构建时间数据,见下表:

esbuild 实验记录

表中 加粗斜体 数字为3次数据平均值,使用平均值对比速度变化,得:

esbuild 速度变化

esbuild 速度提升比率

结论

esbuild 对于构建速度有较为显著的提升。提升比率可达 30%,

@chenbin92 chenbin92 merged commit d99dc67 into release-next Aug 3, 2020
@delete-merged-branch delete-merged-branch bot deleted the feat/plugin-esbuild branch August 3, 2020 06:14
@chenbin92 chenbin92 mentioned this pull request Aug 6, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants