diff --git a/examples/cra-ts-kitchen-sink/.storybook/main.ts b/examples/cra-ts-kitchen-sink/.storybook/main.ts index 47edaa9ba3f..7a5014ed987 100644 --- a/examples/cra-ts-kitchen-sink/.storybook/main.ts +++ b/examples/cra-ts-kitchen-sink/.storybook/main.ts @@ -1,4 +1,6 @@ -// @ts-ignore +// eslint-disable-next-line import/no-extraneous-dependencies +import { Configuration } from 'webpack'; + const path = require('path'); module.exports = { @@ -26,10 +28,12 @@ module.exports = { '@storybook/addon-links', '@storybook/addon-a11y', ], - webpackFinal: (config) => { + webpackFinal: (config: Configuration) => { // add monorepo root as a valid directory to import modules from config.resolve.plugins.forEach((p) => { + // @ts-ignore if (Array.isArray(p.appSrcs)) { + // @ts-ignore p.appSrcs.push(path.join(__dirname, '..', '..', '..')); } }); diff --git a/lib/core/src/server/manager/manager-webpack.config.js b/lib/core/src/server/manager/manager-webpack.config.js index 1be55483384..04b5b7eb70c 100644 --- a/lib/core/src/server/manager/manager-webpack.config.js +++ b/lib/core/src/server/manager/manager-webpack.config.js @@ -140,7 +140,6 @@ export default async ({ alias: { ...themingPaths, ...uiPaths, - semver: require.resolve('@storybook/semver'), }, plugins: [ // Transparently resolve packages via PnP when needed; noop otherwise diff --git a/lib/core/src/server/preview/iframe-webpack.config.js b/lib/core/src/server/preview/iframe-webpack.config.js index 9f44ac8ab6e..5a544e2e2e0 100644 --- a/lib/core/src/server/preview/iframe-webpack.config.js +++ b/lib/core/src/server/preview/iframe-webpack.config.js @@ -181,7 +181,6 @@ export default async ({ alias: { ...themingPaths, ...storybookPaths, - semver: path.dirname(resolveFrom(__dirname, '@storybook/semver/package.json')), ...reactPaths, },