Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cae068b

Browse files
fix(@schematics/angular): update library schematic to use @angular-devkit/build-angular:ng-packagr
The library schematic currently relies on Karma, which requires `@angular-devkit/build-angular` to be installed. To address this, we now use the `ng-packagr` builder provided in this package. Closes #29494
1 parent f743a63 commit cae068b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎packages/schematics/angular/library/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ function addDependenciesToPackageJson() {
5353
},
5454
{
5555
type: NodeDependencyType.Dev,
56-
name: '@angular/build',
57-
version: latestVersions.AngularBuild,
56+
name: '@angular-devkit/build-angular',
57+
version: latestVersions.DevkitBuildAngular,
5858
},
5959
{
6060
type: NodeDependencyType.Dev,
@@ -91,7 +91,7 @@ function addLibToWorkspaceFile(
9191
prefix: options.prefix,
9292
targets: {
9393
build: {
94-
builder: Builders.BuildNgPackagr,
94+
builder: Builders.NgPackagr,
9595
defaultConfiguration: 'production',
9696
options: {
9797
project: `${projectRoot}/ng-package.json`,

‎packages/schematics/angular/library/index_spec.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,9 @@ describe('Library Schematic', () => {
388388
const tree = await schematicRunner.runSchematic('library', defaultOptions, workspaceTree);
389389

390390
const workspace = JSON.parse(tree.readContent('/angular.json'));
391-
expect(workspace.projects.foo.architect.build.builder).toBe('@angular/build:ng-packagr');
391+
expect(workspace.projects.foo.architect.build.builder).toBe(
392+
'@angular-devkit/build-angular:ng-packagr',
393+
);
392394
});
393395

394396
describe('standalone=false', () => {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /