无法在 ObservableHQ 中导入 JS 包 BigDecimal

It is not possible to import JS package BigDecimal inside ObservableHQ

我正在玩 ObservableHQ and decided to use the BigDecimal package。但是当我使用 require 函数使其可用时,我得到以下反馈:

我尝试按照 Introduction to require and debug it with the Module require debugger 中的说明进行操作,但我是 JavaScript 的新手,这些信息并没有太大帮助。

我 运行 它在 Ubuntu 18.04 中的 Firefox 75.0 中。

为什么我无法导入包?这是我的设置问题还是包裹的特定条件?

您可以使用 require 和 big-decimal for the web 导入它

bigDecimal = await require('js-big-decimal/dist/web/js-big-decimal.min.js').catch(
  () => window.bigDecimal
)

https://github.com/royNiladri/js-big-decimal#usage