mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 01:31:05 +08:00
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import path from 'path';
|
|
import { PresetProperty } from '@storybook/types';
|
|
import { StorybookConfig } from './types';
|
|
|
|
export const addons: PresetProperty<'addons', StorybookConfig> = [
|
|
require.resolve('./server/framework-preset-angular-cli'),
|
|
require.resolve('./server/framework-preset-angular-ivy'),
|
|
require.resolve('./server/framework-preset-angular-docs'),
|
|
];
|
|
|
|
export const previewAnnotations: StorybookConfig['previewAnnotations'] = (entries = []) => [
|
|
...entries,
|
|
require.resolve('./client/config'),
|
|
];
|
|
|
|
export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => {
|
|
const framework = await options.presets.apply<StorybookConfig['framework']>('framework');
|
|
|
|
return {
|
|
...config,
|
|
builder: {
|
|
name: path.dirname(
|
|
require.resolve(path.join('@storybook/builder-webpack5', 'package.json'))
|
|
) as '@storybook/builder-webpack5',
|
|
options: typeof framework === 'string' ? {} : framework.options.builder || {},
|
|
},
|
|
};
|
|
};
|
|
|
|
export const typescript: PresetProperty<'typescript', StorybookConfig> = async (config) => {
|
|
return {
|
|
...config,
|
|
skipBabel: true,
|
|
};
|
|
};
|