I have a storybook start script which I want to run for some specific folder:
"storybook": "start-storybook -p 6006 -s ./src" This loads all stories from src folder. As the amount of stories becomes larger, I want to run stories only from some of subfolders:
start-storybook -p 6006 -s ./src/components/CommonComponents start-storybook -p 6006 -s ./src/components/DashboardComponents How can I format argument value dynamically in order to start storybook like this below?
$ yarn storybook CommonComponents And it would turn into:
start-storybook -p 6006 -s ./src/components/CommonComponents
"storybook": "func() { start-storybook -p 6006 -s \"./src/${1}\"; }; func", then run the following command:yarn run storybook components/CommonComponents. For a cross-plaform solution you'll need to consider writing a node.js script which is also described in my answer here.