如何从反应项目中删除故事书 [英] How to remove storybook from the react project
问题描述
如何从 react 项目中卸载 storybook?我应该使用什么命令来卸载故事书?
How to uninstall storybook from the react project ? what is the command should I've to use to uninstall storybook?
推荐答案
他们没有自动执行此操作的 cli 命令.按照以下步骤从您的项目中删除故事书
They don't have a cli command to automate this. Follow the following steps to remove storybook from your project
- 删除你的故事
- 删除 .storybook 文件夹
- 删除添加到 package.json 的脚本
- 从 package.json 中删除所有故事书相关的依赖
- 运行 yarn 或 npm 来更新锁文件
Storybook 直到运行时才知道您的故事在哪里,因此很难确切知道要删除哪些内容.此外,用户有时在 1 个 repo 中有多个故事书,因此总体而言相当复杂.添加文件通常比删除文件更安全……我们可能会删除用户无法从中恢复的内容.
Storybook doesn't know where your stories are until runtime, so it's hard to know exactly what to delete. Also users sometimes have multiple storybooks in 1 repo, so overall it's rather complicated. Adding files is usually safer then removing... we might remove something that the user can't recover from.
这篇关于如何从反应项目中删除故事书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!