Frontend & browser·Modules, bundling and the build
the package only shipped `require` and your bundler could not shake anything out of it.
CommonJS
Also calledCJS, require, module.exports
Node's original module format, where `require` is a function call that runs at execution time and `module.exports` can be reassigned conditionally. Because the exports are only known by running the code, bundlers must include the whole module, so a CommonJS-only dependency defeats tree shaking. The mismatch between the two formats is behind most 'cannot use import statement outside a module' and default-interop errors.