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

feat: experiment with onDisabledRemoveStorybook option #622

Open
wants to merge 4 commits into
base: next
Choose a base branch
from

Conversation

dannyhw
Copy link
Member

@dannyhw dannyhw commented Oct 15, 2024

Issue:

What I did

Adds an option to remove storybook when withStorybook metro config is set to disabled

try it out with 8.3.10-alpha.0

heres an example of usage:

module.exports = withStorybook(finalConfig, {
  enabled: process.env.STORYBOOK_ENABLED === 'true',
  configPath: path.resolve(__dirname, './.storybook'),
  onDisabledRemoveStorybook: true,
});

It applies this config

{
  resolver: {
    resolveRequest: (context, moduleName, platform) => {
      if (
        moduleName.startsWith("storybook") ||
        moduleName.startsWith("@storybook")
      ) {
        return {
          type: "empty",
        };
      }

      return context.resolveRequest(context, moduleName, platform);
    },
  },
};

How to test

Please explain how to test your changes and consider the following questions

  • Does this need a new example in examples/expo-example?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

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.

1 participant