1
0
mirror of https://github.com/storybookjs/storybook.git synced 2025-04-05 02:21:05 +08:00
2021-02-03 22:34:44 +08:00

17 lines
538 B
JavaScript

const getFrameworkPresets = (framework) => {
try {
return [require.resolve(`./dist/cjs/frameworks/${framework}/preset`)];
} catch (err) {
// there is no custom config for the user's framework, do nothing
return [];
}
};
module.exports = (storybookOptions, presetOptions) => {
return [
{ name: require.resolve('./common-preset'), options: presetOptions },
{ name: require.resolve('./dist/cjs/frameworks/common/preset'), options: presetOptions },
...getFrameworkPresets(storybookOptions.framework),
];
};