11
How do I structure a library for NPM (With modules)
(lemmy.world)
I would recommend checking out Rollup (https://rollupjs.org/introduction/).
Rollup is one option that will fit a lot of situations, but there are other ways to bundle a library/module that focus more on how you want to use it. Is it used by other libs, by a UI application, etc.