docs: add asset info to library guide (#34217)

PR Close #34217
This commit is contained in:
Judy Bogart 2019-12-03 10:41:31 -08:00 committed by Kara Erickson
parent 5de5b52beb
commit 26b17aee14
1 changed files with 13 additions and 0 deletions

View File

@ -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.
</div>
{@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).