简体   繁体   English

如何扩展create-react-app?

[英]How to extend create-react-app?

Is there a way to extend wonderful create-react-app with my own libs, webpack configs, dotfiles, etc., but keep it up to date? 有没有办法用我自己的库,webpack配置,dotfiles等扩展精彩的create-react-app ,但保持最新状态?

I mean, I want to eject it, then polish it to my needs but get the latest updates without big pain, ie tracking the repo manually, looking for diffs, copying and pasting and so on. 我的意思是,我想将其eject ,然后根据需要进行抛光,但可以毫不费力地获取最新更新,即手动跟踪存储库,查找差异,复制和粘贴等。

Yes, actually you can! 是的,实际上可以! What you do is that you fork, modify and publish react-scripts and refer to those when scaffolding with create-react-app : 您要做的是创建,修改和发布react-scripts并在使用create-react-app搭建脚手架时引用它们:

$ create-react-app my-app --scripts-version react-scripts-fork

Here you can read more about react-scripts . 在这里,您可以阅读有关react-scripts更多信息。

Here is an article about how to fork and modify react-scripts to your own needs. 这是一篇有关如何根据自己的需要派生和修改react-scripts的文章。

It might be that custom-react-scripts already has implemented what you are looking for, ie SASS or decorators. 可能custom-react-scripts已经实现了您要查找的内容,即SASS或装饰器。 Here is an article about custom-react-scripts and here is the package . 这是一篇有关custom-react-scripts的文章这是软件包

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM