Skip to content

Commit

Permalink
Update lib/docs-tools/src/hasDocsOrControls.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Coleman <tom@chromatic.com>
  • Loading branch information
shilman and tmeasday authored Mar 14, 2022
1 parent b3d5068 commit 2c351b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/docs-tools/src/hasDocsOrControls.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StorybookConfigOptions } from '@storybook/core-common';

// addons/x is for the monorepo
const packageRe = /addon(s\/|-)(docs|controls)/;
// `addons/x` is for the monorepo, `addon-x` is for normal usage
const packageRe = /(addons\/|addon-)(docs|controls)/;

export const hasDocsOrControls = (options: StorybookConfigOptions) =>
options.presetsList?.some((preset) => packageRe.test(preset.name));

0 comments on commit 2c351b3

Please sign in to comment.