In the folder generated by ng build simple-lib, I see a more complex structure than my other node modules. Instead of an index.js exporting and importing other members, I see a bundles, esm2015, esm5, and public_api.d.ts.
I see the compiled versions of simple-lib in both the esm5 and esm2015 folders. I'm wondering how the esm .js files are used and when esm2015 would be used instead of esm5. From what I understand, esm2015 allows for smaller bundles and tree-shaking, but I'm not sure when the choice is made about which module to use. I'm hoping to generate a lib that I can use in a node project and any help to understand if and how that would be possible would be appreciated. Thanks.
$ tree simple-lib/
simple-lib/
├── bundles
│ ├── simple-lib.umd.js
│ ├── simple-lib.umd.js.map
│ ├── simple-lib.umd.min.js
│ └── simple-lib.umd.min.js.map
├── esm2015
│ ├── lib
│ │ ├── simple-lib.component.js
│ │ ├── simple-lib.module.js
│ │ └── simple-lib.service.js
│ ├── public_api.js
│ └── simple-lib.js
├── esm5
│ ├── lib
│ │ ├── simple-lib.component.js
│ │ ├── simple-lib.module.js
│ │ └── simple-lib.service.js
│ ├── public_api.js
│ └── simple-lib.js
├── fesm2015
│ ├── simple-lib.js
│ └── simple-lib.js.map
├── fesm5
│ ├── simple-lib.js
│ └── simple-lib.js.map
├── lib
│ ├── simple-lib.component.d.ts
│ ├── simple-lib.module.d.ts
│ └── simple-lib.service.d.ts
├── package.json
├── public_api.d.ts
├── simple-lib.d.ts
└── simple-lib.metadata.json