fix(angular): do not add target defaults for the ng-packagr-lite executor when generating non-buildable library (#21935)
This commit is contained in:
parent
5d6abe437d
commit
41fc8354a0
@ -8,11 +8,6 @@ export function addProject(
|
|||||||
tree: Tree,
|
tree: Tree,
|
||||||
libraryOptions: NormalizedSchema['libraryOptions']
|
libraryOptions: NormalizedSchema['libraryOptions']
|
||||||
) {
|
) {
|
||||||
const executor = libraryOptions.publishable
|
|
||||||
? '@nx/angular:package'
|
|
||||||
: '@nx/angular:ng-packagr-lite';
|
|
||||||
|
|
||||||
addBuildTargetDefaults(tree, executor);
|
|
||||||
const project: AngularProjectConfiguration = {
|
const project: AngularProjectConfiguration = {
|
||||||
name: libraryOptions.name,
|
name: libraryOptions.name,
|
||||||
root: libraryOptions.projectRoot,
|
root: libraryOptions.projectRoot,
|
||||||
@ -20,10 +15,17 @@ export function addProject(
|
|||||||
prefix: libraryOptions.prefix,
|
prefix: libraryOptions.prefix,
|
||||||
tags: libraryOptions.parsedTags,
|
tags: libraryOptions.parsedTags,
|
||||||
projectType: 'library',
|
projectType: 'library',
|
||||||
targets: {
|
targets: {},
|
||||||
build:
|
};
|
||||||
libraryOptions.buildable || libraryOptions.publishable
|
|
||||||
? {
|
if (libraryOptions.buildable || libraryOptions.publishable) {
|
||||||
|
const executor = libraryOptions.publishable
|
||||||
|
? '@nx/angular:package'
|
||||||
|
: '@nx/angular:ng-packagr-lite';
|
||||||
|
|
||||||
|
addBuildTargetDefaults(tree, executor);
|
||||||
|
|
||||||
|
project.targets.build = {
|
||||||
executor,
|
executor,
|
||||||
outputs: ['{workspaceRoot}/dist/{projectRoot}'],
|
outputs: ['{workspaceRoot}/dist/{projectRoot}'],
|
||||||
options: {
|
options: {
|
||||||
@ -38,10 +40,8 @@ export function addProject(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultConfiguration: 'production',
|
defaultConfiguration: 'production',
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
addProjectConfiguration(tree, libraryOptions.name, project);
|
addProjectConfiguration(tree, libraryOptions.name, project);
|
||||||
return project;
|
return project;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user