fix(storybook): storybook migration fails if targets not defined on a project (#7475)

This commit is contained in:
Craigory Coppola 2021-10-21 14:48:49 -05:00 committed by GitHub
parent 0fe1614505
commit c87dfad2df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,9 +26,11 @@ export default async function addStyledJsxTypings(tree: Tree) {
),
};
const storybookExecutor = Object.keys(targets).find(
(x) => targets[x].executor === '@nrwl/storybook:storybook'
);
const storybookExecutor =
targets &&
Object.keys(targets).find(
(x) => targets[x].executor === '@nrwl/storybook:storybook'
);
const hasStorybookConfig =
storybookExecutor && tree.exists(paths.tsConfigStorybook);