-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@schematics/angular): add standalone option to library library
This commit fixes an issue were libraries could not be created with standalone APIs. Standalone libraries do not have an an NgModule. When consumed users need to import the needed components, pipes, and directives. It is also recommended not to avoid grouping exports as this typically indicates bad architecture and may also hinder tree-shaking. **Don't** ```ts export const COMPONENTS = [ FooComponent, BarComponent, ] ``` **Do** ```ts export { FooComponent } from './foo/foo.component'; export { BarComponent } from './bar/bar.component'; ``` (cherry picked from commit 0c9d137)
- Loading branch information
1 parent
c272172
commit a5cb461
Showing
6 changed files
with
83 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ng } from '../../../utils/process'; | ||
import { useCIChrome } from '../../../utils/project'; | ||
|
||
export default async function () { | ||
await ng('generate', 'library', 'lib-ngmodule', '--no-standalone'); | ||
await useCIChrome('lib-ngmodule', 'projects/lib-ngmodule'); | ||
await ng('test', 'lib-ngmodule', '--no-watch'); | ||
await ng('build', 'lib-ngmodule'); | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/legacy-cli/e2e/tests/generate/library/library-standalone.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ng } from '../../../utils/process'; | ||
import { useCIChrome } from '../../../utils/project'; | ||
|
||
export default async function () { | ||
await ng('generate', 'library', 'lib-standalone', '--standalone'); | ||
await useCIChrome('lib-standalone', 'projects/lib-standalone'); | ||
await ng('test', 'lib-standalone', '--no-watch'); | ||
await ng('build', 'lib-standalone'); | ||
} |