While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based mostly on what the JavaScript and in particular Node community at large have been following by convention.
Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.
- src/is for the code you write manually independent of the module format
- lib/is for modules compiled from- src/into a format compatible with standard- requirein the node versions indicated by- enginesin your- package.json(UMD, CommonJS)
- dist/is for modules or scripts compiled from- src/into formats not compatible with standard- requirein the node versions indicated by- enginesin your- package.json(AMD, browser globals/IIFE)