I'm really struggling to figure out the best approach for setting up my package.json file. I have a JavaScript module that contains multiple reusable JS files, let's call it Module1.
In Module1's package.json, the name attribute is set to "Module1" so that any modules dependent on it can simply require("Module1"). This part makes sense to me. However, it also requires a "main" attribute pointing to the main JS file that will be returned when required. This is where I'm running into confusion. Module1 doesn't have a single main JS file; it's a collection of reusable JS files, each with its own module.exports returning the internal object in that file. There isn't one central JS file that binds them together, so what should be used as the main entry point? Is it possible to concatenate all these files into one bundle file? And if so, how would require know what to return when there are multiple module.exports?
Any help would be greatly appreciated.