From 0f9b1057d269f32279c0edd20dc9eb3b553ff07b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 12 Jul 2024 14:58:03 +0200 Subject: [PATCH] add theming/create aliases in docs preset --- code/addons/docs/src/preset.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 9f50f7d9a254..0ad19b34bd58 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -70,6 +70,8 @@ async function webpack( */ const cliPath = require.resolve('storybook/package.json'); const themingPath = join(cliPath, '..', 'core', 'theming', 'index.js'); + const themingCreatePath = join(cliPath, 'core', 'theming', 'create.js'); + const componentsPath = join(cliPath, '..', 'core', 'components', 'index.js'); const blocksPath = dirname(require.resolve('@storybook/blocks/package.json')); if (Array.isArray(webpackConfig.resolve?.alias)) { @@ -87,6 +89,10 @@ async function webpack( name: '@mdx-js/react', alias: mdx, }, + { + name: '@storybook/theming/create', + alias: themingCreatePath, + }, { name: '@storybook/theming', alias: themingPath, @@ -104,6 +110,7 @@ async function webpack( alias = { ...webpackConfig.resolve?.alias, react, + '@storybook/theming/create': themingCreatePath, '@storybook/theming': themingPath, '@storybook/components': componentsPath, '@storybook/blocks': blocksPath, @@ -168,6 +175,7 @@ export const viteFinal = async (config: any, options: Options) => { const cliPath = dirname(require.resolve('storybook/package.json')); const themingPath = join(cliPath, 'core', 'theming', 'index.js'); + const themingCreatePath = join(cliPath, 'core', 'theming', 'create.js'); const componentsPath = join(cliPath, 'core', 'components', 'index.js'); const blocksPath = dirname(require.resolve('@storybook/blocks/package.json')); @@ -187,6 +195,7 @@ export const viteFinal = async (config: any, options: Options) => { * * In the future the `@storybook/theming` and `@storybook/components` can be removed, as they should be singletons in the future due to the peerDependency on `storybook` package. */ + '@storybook/theming/create': themingCreatePath, '@storybook/theming': themingPath, '@storybook/components': componentsPath, '@storybook/blocks': blocksPath,