react-native-storybook-loader
react-native-storybook-loader copied to clipboard
Pattern to ignore
Hi, i would like to know if it's possible to ignore certain patterns. i'm trying to use this library with Expo. So, i have some logic to name certain files that are able to run exclusively for native as *.native.stories
and other exclusively on web as *.web.stories
.
Can you add support to glob.sync
internally?. That function has an ignore feature. Due, i'm using two storybook instances, the web instance uses something like the following and it works like a charm:
const glob = require("glob");
const path = require("path");
const appDirectory = path.resolve(__dirname, "../");
const getStories = () =>
glob.sync(`${appDirectory}/components/**/*.stories.tsx`, {
ignore: `${appDirectory}/components/**/*.native.stories.tsx`,
});
Then, we would be able to dynamically ignore with something like:
//package.json
{
"config": {
"react-native-storybook-loader": {
"searchDir": [ "./components" ],
"pattern": "**/*.stories.tsx",
"ignore": "**/*.web.stories.tsx",
"outputFile": "storybook/storyLoader.js"
}
},
}