Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Investigate how to stop building @bufferapp/ui with commonjs #237

@msanroman

Description

@msanroman

What

  • Remove commonjs-related build steps.
  • Make sure we are able to export independently any component (without bringing in the whole library).
  • Test:
    • Run https://www.npmjs.com/package/webpack-bundle-analyzer on a product repo (best to try with bufferapp/buffer-engage-client).
    • Install beta version with these changes on that repo.
    • Run the bundle analyzer again: we should see a decrease in size regarding what's brought by bufferapp/ui

Why
We have a Babel plugin called @babel/plugin-transform-modules-commonjs (https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs) transforming ECMAScript modules to CommonJS. Our bundle is much bigger, and we can't use tree shaking (we could have a third-party webpack plugin on top of that to get tree shaking but doesn't seem efficient)

Metadata

Metadata

Assignees

Labels

scopingTasks involving investigation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions