I am learning how angular (4+) compile project AOT to create a library and I some questions about the files generated. I wrote a script in order to create esm and umd bundle (.js and .map.js), metadata and types for each file (ngc) and the package.json (where I defined entry points for bundle)
{
"main": "maestro.umd.js",
"jsnext:main": "maestro.esm.js",
"module": "maestro.esm.js",
"types": "index.d.ts"
}
However, even if JIT compilation worked correctly when I integrated my bundle in the main project, I had an issue with AOT one. In order to resolve it, I had to copy every .js files generated by ngc inside the dist folder. So, to resume I deliver these files for my library:
- package.json
- esm bundle (.js and .map.js)
- umd bundle (.js and .map.js)
- ngc generated files (.d.ts, .metadata.json and .js for each .ts file)
Could someone please confirm me that we need .js files? Could it be possible to use umd bundle during AOT compilation instead?