mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-15 10:42:25 +03:00
Test
This commit is contained in:
parent
4f36bded5e
commit
a42f0403f8
|
@ -1,18 +1,20 @@
|
||||||
import type { StorybookConfig } from '@storybook/react-webpack5';
|
import { createRequire } from 'node:module';
|
||||||
|
import path from 'node:path';
|
||||||
|
|
||||||
import { join, dirname } from 'path';
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to resolve the absolute path of a package.
|
* This function is used to resolve the absolute path of a package.
|
||||||
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
||||||
*/
|
*/
|
||||||
function getAbsolutePath(value: string): any {
|
function getAbsolutePath(packageName) {
|
||||||
return dirname(require.resolve(join(value, 'package.json')));
|
return path.dirname(require.resolve(path.join(packageName, 'package.json')));
|
||||||
}
|
}
|
||||||
const config: StorybookConfig = {
|
|
||||||
|
const config = {
|
||||||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
||||||
addons: [
|
addons: [
|
||||||
'./swc-preset.mjs',
|
getAbsolutePath('@storybook/addon-webpack5-compiler-swc'),
|
||||||
getAbsolutePath('@storybook/addon-onboarding'),
|
getAbsolutePath('@storybook/addon-onboarding'),
|
||||||
getAbsolutePath('@storybook/addon-links'),
|
getAbsolutePath('@storybook/addon-links'),
|
||||||
{
|
{
|
||||||
|
@ -33,4 +35,5 @@ const config: StorybookConfig = {
|
||||||
},
|
},
|
||||||
staticDirs: ['../fonts'],
|
staticDirs: ['../fonts'],
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
|
@ -1 +0,0 @@
|
||||||
export * from '@storybook/addon-webpack5-compiler-swc';
|
|
Loading…
Reference in New Issue
Block a user