Skip to content

Commit

Permalink
fix(react): storybook plugin tsconfig resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Oct 16, 2023
1 parent a71eb1b commit b2ae986
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react/plugins/storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ export const webpack = async (
const { withNx, withWeb } = require('@nx/webpack');

const projectData = await getProjectData(options);
const tsconfigPath = join(projectData.projectRoot, 'tsconfig.storybook.json');
const tsconfigPath = existsSync(
join(projectData.projectRoot, 'tsconfig.storybook.json')
)
? join(projectData.projectRoot, 'tsconfig.storybook.json')
: join(projectData.projectRoot, 'tsconfig.json');
// The 'tsconfig.json' is mainly for the cypress test to be able to run
// because it will look into the cypress project dir and it will not find tsconfig.storybook.json

fixBabelConfigurationIfNeeded(storybookWebpackConfig, projectData);

Expand Down

0 comments on commit b2ae986

Please sign in to comment.