Skip to content

Get rid of CommonJS dependencies #523

Description

@manuelwedler

Since Angular version 10 the Angular cli warns about used CommonJS dependencies, because they can cause larger bundle sizes. See https://angular.io/guide/build#configuring-commonjs-dependencies for reference.

The cli warnings are currently suppressed by the allowedCommonJsDependencies option:

webui/angular.json

Lines 29 to 50 in e091b8a

"allowedCommonJsDependencies": [
"bignumber.js",
"qrcode",
"ajv",
"web3",
"web3-utils",
"web3-core",
"web3-core-helpers",
"web3-core-requestmanager",
"web3-eth-personal",
"web3-net",
"web3-eth",
"web3-bzz",
"web3-shh",
"web3-providers-http",
"web3-providers-ws",
"web3-providers-ipc",
"randombytes",
"underscore",
"ethjs-unit",
"elliptic"
]

We should try to only use ECMAScript modules in the future. Some dependencies like web3 are already working on providing an ES module.

Activity

  1. added this to the Product Backlog milestone on Jul 17, 2020
  2. manuelwedler commented on Apr 19, 2021

    @manuelwedler
    ContributorAuthor

    Using import { BigNumber } from 'bignumber.js/bignumber'; should fix it for bignumber.js, see MikeMcl/bignumber.js#278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions