Skip to content

big.js is a CommonJS dependency #170

@kbeelman

Description

@kbeelman

Steps to reproduce:

  1. Use npm to install big.js in an Angular 10+ library.
  2. Import big.js into a file in the Angular library.
    In this case import Big from 'big.js';, import { Big } from 'big.js'; and import * as Big from 'big.js'; all behave the same.
  3. Build the library.
  4. Install the library in an Angular 10+ project and build that project.
  5. Get the following error:
    WARNING in <PROJECT_DIRECTORY>\node_modules\<PARENT_PACKAGE>\__ivy_ngcc__\<PACKAGE_NAME>\fesm2015\<PROJECT_NAME>.js depends on 'big.js'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

It seems that the big.js package provided by npm doesn't properly export its ES Module. Upon looking into the package, I do see big.mjs, but any attempt at doing something like import Big from 'big.js\big.mjs'; causes a compilation failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions