2024-10-23 16:20:53 +02:00

21 lines
567 B
TypeScript

import { isAbsolute, join } from 'node:path';
import { checkAddonOrder, serverRequire } from 'storybook/internal/common';
export const checkActionsLoaded = (configDir: string) => {
checkAddonOrder({
before: {
name: '@storybook/addon-actions',
inEssentials: true,
},
after: {
name: '@storybook/addon-interactions',
inEssentials: false,
},
configFile: isAbsolute(configDir)
? join(configDir, 'main')
: join(process.cwd(), configDir, 'main'),
getConfig: (configFile) => serverRequire(configFile),
});
};