From 70429bf3505e906caab925660c856f4b33a57afa Mon Sep 17 00:00:00 2001 From: Judy Bogart Date: Tue, 1 Oct 2019 10:34:21 -0700 Subject: [PATCH] docs: add lib build note (#32940) PR Close #32940 --- aio/content/guide/creating-libraries.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aio/content/guide/creating-libraries.md b/aio/content/guide/creating-libraries.md index 2936581999..98f06d39dd 100644 --- a/aio/content/guide/creating-libraries.md +++ b/aio/content/guide/creating-libraries.md @@ -193,3 +193,18 @@ Incremental builds can be run as a background process in your dev environment. T ng build my-lib --watch + +
+ +The CLI `build` command uses a different builder and invokes a different build tool for libraries than it does for applications. + +* The build system for apps, `@angular-devkit/build-angular`, is based on `webpack`, and is included in all new Angular CLI projects. +* The build system for libraries is based on `ng-packagr`. It is only added to your dependencies when you add a library using `ng generate library my-lib`. + +The two build systems support different things, and even where they support the same things, they do those things differently. +This means that the TypeScript source can result in different JavaScript code in a built library than it would in a built application. + +For this reason, an app that depends on a library should only use TypeScript path mappings that point to the *built library*. +TypeScript path mappings should *not* point to the library source `.ts` files. + +
\ No newline at end of file