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: onDisabledRemoveStorybook option #622

Merged
merged 9 commits into from
Oct 22, 2024

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.

@dannyhw dannyhw changed the title feat: experiment with onDisabledRemoveStorybook option feat: onDisabledRemoveStorybook option Oct 22, 2024
@dannyhw dannyhw merged commit bc326fc into next Oct 22, 2024
1 check passed
@dannyhw dannyhw deleted the feat/remove-storybook-from-bundle-option branch October 22, 2024 19:03
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