Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What am I seeing when I build an angular library (bundle, esm5, esm2015, fesm5 and fesm2015)

Trying to understand what is output from build an Angular8 library (since it builds 5 similar looking things, the build time has gone up for each library) - What am I seeing when I build an angular library (bundle, esm5, esm2015, fesm5 and fesm2015)? Can I teach the Angular8 to only give me ESM5 or UMD modules for my libraries and not spend extra time generating these unwanted "modern browser" stuff?

I read a bit about differential loading but does not seem to make sense from the point of view of building Angular8 libraries.

Any pointers are appreciated.

like image 809
user2789284 Avatar asked Sep 05 '19 23:09

user2789284


People also ask

What is FESM5 in angular?

fesm5 - flattened version of esm5. fesm2015 - flattened version of peerDependencies esm2015. lib - TypeScript definitions for the library.

What is FESM2015?

The shortened name “FESM” (pronounced “phesom”) can have a number after it such as “FESM5” or “FESM2015”. The number refers to the language level of the JavaScript inside the module. So a FESM5 file would be ESM+ES5 (import/export statements and ES5 source code).

What is angular library?

An Angular library is an Angular project that differs from an application in that it cannot run on its own. A library must be imported and used in an application. Libraries extend Angular's base features.


1 Answers

Have a look at https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview (chapter "Compilation and transpilation"). Hope that helps!

Found the link in this blog post, which is s nice introduction: http://willtaylor.blog/complete-guide-to-angular-libraries/

like image 164
dg_emp Avatar answered Sep 16 '22 14:09

dg_emp