Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
big.js node module not working with webpack

I'm trying to use webpack to compile (typescript files) and bundle up my source code. Here is my current webpack.config.js file:

const path = require('path')

module.exports = {
  devtool: 'eval-source-map',
  entry: './src/main.ts',
  module: {
    rules: [
      {
        test: /\.ts$/,
        use: 'ts-loader',
        include: [
          path.resolve(__dirname, 'src'),
        ]
      }
    ]
  },
  resolve: {
    extensions: ['.ts', '.js']
  },
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist')
  }
}

I also have big.js installed as a node module. However, when I run webpack and bundle all the files into bundle.js. It runs the bundled code (known by console.log messages printing to console), but I get the following error in the browser:

Uncaught Error: Cannot find module 'big.js'

and it points to the following line of code:

import Big from "big.js";

I know big.js is included because looking in the bundle.js file, the top of the file has the big.js bundled (shown as below):

(()=>{var __webpack_modules__={302:function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*\r\n *  big.js v6.1.1\r\n *  A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.\r\n *  Copyright (c) 2021 Michael Mclaughlin\r\n *  https://github.com/MikeMcl/big.js/LICENCE.md\r\n */\r\n;(function (GLOBAL) {\r\n  'use strict';\r\n  var Big,\r\n\r\n\r\n/...

This is my first time using webpack and big.js so the solution is hopefully simple, but if someone knew what the issue was, your help would be appreciated. If any further information is needed, let me know.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!