Skip to content

Use esbuild as a JavaScript minifier

Lukas 'ai-pi' Eipert requested to merge leipert-use-esbuild-as-minifier into master

What does this MR do?

esbuild provides a much higher performance than the default Terser plugin. We could potentially use esbuild instead of babel as well, but there are currently two caveats where babel wins:

  • We need to pre-process our JS for webpack@4, as it uses an older version of acorn.
  • We automatically polyfill based on babel-preset-env

Preliminary tests have shown that even the minification step could reduce compilation times more than half, on my machine 12 => 4 minutes.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Lukas 'ai-pi' Eipert

Merge request reports