-
Hello, I'm using Storybook in my applications and it does its job well for what I'm really thankful! My question is though, is there any way to complete get rid of anything related to Storybook in release/production builds? What I mean: At the start we have to configure Storybook and feed it stories like so: import {configure} from "@storybook/react-native";
import "./storybook.config";
configure(() => {
require("./storybook/stories.ts");
}, module); And I can't simply use conditional imports without adding a babel plugin to do so. Also in addition to configuration I have stories which are getting bundled too. Is it getting handled under the hood or not? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Using require inline is away of doing conditional imports that already works without babel. It would be best to do some testing but if you do the require in line after some condition it should be possible.
Something like this could probably work. This is because requires aren't hoisted in the same way as imports (as far as I know) |
Beta Was this translation helpful? Give feedback.
Using require inline is away of doing conditional imports that already works without babel. It would be best to do some testing but if you do the require in line after some condition it should be possible.
Something like this could probably work. This is because requires aren't hoisted in the same way as imports (as far as I know)