CLI

generate library

Command
ng generate library
ng generate lib

Creates a new, generic library project in the current workspace.

Arguments

name

The name of the library.

Value Typestring

Options

entry-file

The path at which to create the library's public API file, relative to the workspace root.

Value TypestringDefaultpublic-api
prefix
Aliasp

A prefix to apply to generated selectors.

Value TypestringDefaultlib
project-root

The root directory of the new library.

Value Typestring
skip-install

Do not install dependency packages.

Value TypebooleanDefaultfalse
skip-package-json

Do not add dependencies to the "package.json" file.

Value TypebooleanDefaultfalse
skip-ts-config

Do not update "tsconfig.json" to add a path mapping for the new library. The path mapping is needed to use the library in an app, but can be disabled here to simplify development.

Value TypebooleanDefaultfalse
standalone

Creates a library based upon the standalone API, without NgModules.

Value TypebooleanDefaulttrue
Jump to details