Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve metro config #428

Merged
merged 3 commits into from
Feb 19, 2023
Merged

fix: improve metro config #428

merged 3 commits into from
Feb 19, 2023

Conversation

matinzd
Copy link
Contributor

@matinzd matinzd commented Feb 17, 2023

Issue: Metro configuration was not extended properly from the default settings.

What I did

Extend metro config values from default configuration.

How to test

  • Run yarn start --reset-cache
  • Should work as expected

@matinzd matinzd requested a review from dannyhw as a code owner February 17, 2023 10:53
@dannyhw
Copy link
Member

dannyhw commented Feb 19, 2023

@matinzd this config didn't work because the root of the mono repo needs to be included and sbmodern needs to be the first in the resolver main fields.

I've pushed the fix and this should work now.

Copy link
Member

@dannyhw dannyhw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matinzd thanks for your contribution 🙇

However please try running the example app before submitting changes

@dannyhw dannyhw merged commit 0d0946b into storybookjs:next-6.0 Feb 19, 2023
@matinzd
Copy link
Contributor Author

matinzd commented Feb 19, 2023

@matinzd this config didn't work because the root of the mono repo needs to be included and sbmodern needs to be the first in the resolver main fields.

I've pushed the fix and this should work now.

It seems I did have some caching issues. Thanks for checking.

@dannyhw
Copy link
Member

dannyhw commented Feb 19, 2023

@matinzd ah I see, its no problem :). Thanks again.

@matinzd
Copy link
Contributor Author

matinzd commented Mar 6, 2023

This is breaking after upgrading to reanimated v3. @dannyhw I think we need to revert back to:

/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @format
 */

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: true,
      },
    }),
  },
  resolver: {
    resolverMainFields: ['sbmodern', 'react-native', 'browser', 'main'],
  },
}

@matinzd matinzd deleted the patch-2 branch April 25, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants