1 | const getFrameworkPresets = (framework) => {
|
2 | try {
|
3 | return [require.resolve(`./dist/cjs/frameworks/${framework}/preset`)];
|
4 | } catch (err) {
|
5 | // there is no custom config for the user's framework, do nothing
|
6 | return [];
|
7 | }
|
8 | };
|
9 |
|
10 | module.exports = (storybookOptions, presetOptions) => {
|
11 | return [
|
12 | { name: require.resolve('./common-preset'), options: presetOptions },
|
13 | { name: require.resolve('./dist/cjs/frameworks/common/preset'), options: presetOptions },
|
14 | ...getFrameworkPresets(storybookOptions.framework),
|
15 | ];
|
16 | };
|