diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 8d2ac3b7e2d4..dea767d83d52 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -194,6 +194,7 @@ export const features = async ( storyStoreV7: true, argTypeTargetsV7: true, legacyDecoratorFileOrder: false, + warnOnIncompatibleAddons: true, }); export const csfIndexer: Indexer = { diff --git a/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts b/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts index a850d49809ad..d5c094cf7a7b 100644 --- a/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts +++ b/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts @@ -6,6 +6,10 @@ import dedent from 'ts-dedent'; import { getIncompatibleAddons } from '../../../cli/src/automigrate/helpers/getIncompatibleAddons'; export const warnOnIncompatibleAddons = async (config: StorybookConfig) => { + if (config.features.warnOnIncompatibleAddons === false) { + return + } + const incompatibleAddons = await getIncompatibleAddons(config); if (incompatibleAddons.length > 0) { diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 0f2a9f54c271..1e41f9b31353 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -159,6 +159,7 @@ export interface CLIOptions { debugWebpack?: boolean; webpackStatsJson?: string | boolean; outputDir?: string; + warnOnIncompatibleAddons?: boolean; } export interface BuilderOptions { @@ -310,6 +311,11 @@ export interface StorybookConfig { * Apply decorators from preview.js before decorators from addons or frameworks */ legacyDecoratorFileOrder?: boolean; + + /** + * Warn when there are incompatible addons detected. + */ + warnOnIncompatibleAddons?: boolean; }; /**