docs: clarify that `--prod` should be used to publish a library (#33959)

PR Close #33959
This commit is contained in:
Alan Agius 2019-11-21 14:56:54 +01:00 committed by Alex Rickabaugh
parent 715d02aa14
commit df71aa425f
1 changed files with 2 additions and 3 deletions

View File

@ -109,11 +109,10 @@ To learn more, see [Schematics Overview](guide/schematics) and [Schematicsfor
## Publishing your library
Use the Angular CLI and the npm package manager to build and publish your library as an npm package.
Libraries are built in [AoT mode](guide/aot-compiler) by default, so you do not need to specify the `-prod` flag when building for publication.
Use the Angular CLI and the npm package manager to build and publish your library as an npm package. It is not recommended to publish Ivy libraries to NPM repositories. Before publishing a library to NPM, build it using the `--prod` flag which will use the older compiler and runtime known as View Engine instead of Ivy.
<code-example language="bash">
ng build my-lib
ng build my-lib --prod
cd dist/my-lib
npm publish
</code-example>