feat(schematics) check to see if a library is publishable before trying to update ng-package.prod.json
This commit is contained in:
parent
9ce52af41f
commit
73d0fb21d0
@ -123,7 +123,7 @@ function addLoadChildren(options: NormalizedSchema): Rule {
|
|||||||
|
|
||||||
const loadChildren = `@${npmScope}/${options.projectDirectory}#${
|
const loadChildren = `@${npmScope}/${options.projectDirectory}#${
|
||||||
options.moduleName
|
options.moduleName
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
insert(host, options.parentModule, [
|
insert(host, options.parentModule, [
|
||||||
...addRoute(
|
...addRoute(
|
||||||
@ -273,7 +273,7 @@ describe('${options.moduleName}', () => {
|
|||||||
...json.compilerOptions,
|
...json.compilerOptions,
|
||||||
outDir: `${offsetFromRoot(options.projectRoot)}dist/out-tsc/${
|
outDir: `${offsetFromRoot(options.projectRoot)}dist/out-tsc/${
|
||||||
options.projectRoot
|
options.projectRoot
|
||||||
}`
|
}`
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
@ -285,7 +285,7 @@ describe('${options.moduleName}', () => {
|
|||||||
...json.compilerOptions,
|
...json.compilerOptions,
|
||||||
outDir: `${offsetFromRoot(options.projectRoot)}dist/out-tsc/${
|
outDir: `${offsetFromRoot(options.projectRoot)}dist/out-tsc/${
|
||||||
options.projectRoot
|
options.projectRoot
|
||||||
}`
|
}`
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
@ -304,10 +304,14 @@ describe('${options.moduleName}', () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
updateJsonInTree(`${options.projectRoot}/ng-package.prod.json`, json => {
|
options.publishable
|
||||||
json['dest'] = `${offsetFromRoot(options.projectRoot)}dist/@${options.prefix}/${options.name}`;
|
? updateJsonInTree(`${options.projectRoot}/ng-package.prod.json`, json => {
|
||||||
return json;
|
return {
|
||||||
}),
|
...json,
|
||||||
|
dest: `${offsetFromRoot(options.projectRoot)}dist/@${options.prefix}/${options.projectDirectory}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
: noop(),
|
||||||
host => {
|
host => {
|
||||||
const karma = host
|
const karma = host
|
||||||
.read(`${options.projectRoot}/karma.conf.js`)
|
.read(`${options.projectRoot}/karma.conf.js`)
|
||||||
@ -340,7 +344,7 @@ function updateTsConfig(options: NormalizedSchema): Rule {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function(schema: Schema): Rule {
|
export default function (schema: Schema): Rule {
|
||||||
return (host: Tree, context: SchematicContext) => {
|
return (host: Tree, context: SchematicContext) => {
|
||||||
const options = normalizeOptions(host, schema);
|
const options = normalizeOptions(host, schema);
|
||||||
if (!options.routing && options.lazy) {
|
if (!options.routing && options.lazy) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user