diff --git a/aio/content/guide/creating-libraries.md b/aio/content/guide/creating-libraries.md index f3e322e337..abfb15cc2c 100644 --- a/aio/content/guide/creating-libraries.md +++ b/aio/content/guide/creating-libraries.md @@ -119,6 +119,7 @@ npm publish If you've never published a package in npm before, you must create a user account. Read more in [Publishing npm Packages](https://docs.npmjs.com/getting-started/publishing-npm-packages). + ## Linked libraries While working on a published library, you can use [npm link](https://docs.npmjs.com/cli/link) to avoid reinstalling the library on every build. @@ -156,6 +157,7 @@ List all the peer dependencies that your library uses in the workspace TypeScrip This mapping ensures that your library always loads the local copies of the modules it needs. + ## Using your own library in apps You don't have to publish your library to the npm package manager in order to use it in your own apps, but you do have to build it first. @@ -213,3 +215,14 @@ For this reason, an app that depends on a library should only use TypeScript pat TypeScript path mappings should *not* point to the library source `.ts` files. + +{@a lib-assets} + +### Managing library assets with ng-packagr + +Starting with version 9.x of the [ng-packagr](https://github.com/ng-packagr/ng-packagr/blob/master/README.md) tool, you can configure the tool to automatically copy assets into your library package as part of the build process. +You can use this feature when your library needs to publish optional theming files, Sass mixins, or documentation (like a changelog). + +* Learn how to [copy assets into your library as part of the build](https://github.com/ng-packagr/ng-packagr/blob/master/docs/copy-assets.md). + +* Learn more about how to use the tool to [embed assets in CSS](https://github.com/ng-packagr/ng-packagr/blob/master/docs/embed-assets-css.md).