Skip to content

Commit

Permalink
fix: run user defined resolver first
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyhw committed Jul 12, 2024
1 parent 56cad3c commit 634d959
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-native/metro/withStorybook.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ module.exports = (config, { configPath, enabled }) => {
...config.resolver,
unstable_enablePackageExports: true,
resolveRequest: (context, moduleName, platform) => {
const defaultResolveResult = context.resolveRequest(context, moduleName, platform);
const defaultResolveResult = config?.resolver?.resolveRequest
? config?.resolver?.resolveRequest?.(context, moduleName, platform)
: context.resolveRequest(context, moduleName, platform);

// workaround for template files with invalid imports
if (defaultResolveResult?.filePath?.includes?.('@storybook/react/template/cli')) {
Expand Down

0 comments on commit 634d959

Please sign in to comment.