mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
[storybook] Watch for changes in packages (#131467)
* [storybook] Watch for changes in packages * Update default_config.ts
This commit is contained in:
parent
07985db97a
commit
01e12ec1d6
1 changed files with 11 additions and 0 deletions
|
@ -14,6 +14,12 @@ import { REPO_ROOT } from './constants';
|
||||||
import { default as WebpackConfig } from '../webpack.config';
|
import { default as WebpackConfig } from '../webpack.config';
|
||||||
|
|
||||||
const toPath = (_path: string) => path.join(REPO_ROOT, _path);
|
const toPath = (_path: string) => path.join(REPO_ROOT, _path);
|
||||||
|
|
||||||
|
// This ignore pattern excludes all of node_modules EXCEPT for `@kbn`. This allows for
|
||||||
|
// changes to packages to cause a refresh in Storybook.
|
||||||
|
const IGNORE_PATTERN =
|
||||||
|
/[/\\]node_modules[/\\](?!@kbn[/\\][^/\\]+[/\\](?!node_modules)([^/\\]+))([^/\\]+[/\\][^/\\]+)/;
|
||||||
|
|
||||||
export const defaultConfig: StorybookConfig = {
|
export const defaultConfig: StorybookConfig = {
|
||||||
addons: ['@kbn/storybook/preset', '@storybook/addon-a11y', '@storybook/addon-essentials'],
|
addons: ['@kbn/storybook/preset', '@storybook/addon-a11y', '@storybook/addon-essentials'],
|
||||||
stories: ['../**/*.stories.tsx', '../**/*.stories.mdx'],
|
stories: ['../**/*.stories.tsx', '../**/*.stories.mdx'],
|
||||||
|
@ -45,6 +51,11 @@ export const defaultConfig: StorybookConfig = {
|
||||||
}
|
}
|
||||||
|
|
||||||
config.node = { fs: 'empty' };
|
config.node = { fs: 'empty' };
|
||||||
|
config.watch = true;
|
||||||
|
config.watchOptions = {
|
||||||
|
...config.watchOptions,
|
||||||
|
ignored: [IGNORE_PATTERN],
|
||||||
|
};
|
||||||
|
|
||||||
// Remove when @storybook has moved to @emotion v11
|
// Remove when @storybook has moved to @emotion v11
|
||||||
// https://github.com/storybookjs/storybook/issues/13145
|
// https://github.com/storybookjs/storybook/issues/13145
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue