When using browserify to bundle two JavaScipt files into one with the command:
browserify X1.js X2.js --standalone XXX > bundle.js
The file X1.js contains a function like this:
function foo() {
console.log("something")
}
And it is being exported in this way:
module.exports = {foo: foo};
The intention is to call that function inside the index.html like so:
XXX.foo()
However, it appears that the module "XXX" is recognized but not the function "foo". Why might this be happening?
Uncaught TypeError: XXX.foo is not a function