Skip to content

feat: Make gitlab-ui tree-shakeable

Lukas 'ai-pi' Eipert requested to merge leipert-tree-shaking into master

The two integration MRs can be found here:

Please test them as well.

We actually save ~100KB by these measures in the "main" bundle"

Before After
2020-02-27T08.52.43 2020-02-27T08.53.19

feat: Make gitlab-ui tree-shakeable

Currently we are fully rolling up bootstrap-vue and gitlab-ui into the entry points:

  • @gitlab/ui (alias for @gitlab/ui/dist/index.js)
  • @gitlab/ui/dist/charts.js
  • @gitlab/ui/dist/utils.js

This results in a pretty big bundle, index.js is currently 752 KB in size, because it contains all components except for our charts.

By disabling the bundling in our builds, we can make usage of webpack's treeshaking capabilities and just import bundles where they are needed.

As a nice side effect, this reduces compilation time substantially.

Edited by Lukas 'ai-pi' Eipert

Merge request reports