Remove logging from hasDocsOrControls

Causes cryptic webpack error in angular-cli example
This commit is contained in:
Michael Shilman 2022-03-14 01:43:33 +08:00
parent 692ed7ce77
commit ccc5ffc502

View File

@ -1,15 +1,7 @@
import type { StorybookConfigOptions } from '@storybook/core-common';
import { once } from '@storybook/node-logger';
// addons/x is for the monorepo
const packageRe = /addon(s\/|-)(docs|controls)/;
export const hasDocsOrControls = (options: StorybookConfigOptions) => {
const found = options.presetsList?.some((preset) => packageRe.test(preset.name));
if (!found) {
once.verbose(
`No docs or controls found in presets: ${options.presetsList?.map((preset) => preset.name)}`
);
}
return found;
};
export const hasDocsOrControls = (options: StorybookConfigOptions) =>
options.presetsList?.some((preset) => packageRe.test(preset.name));