如何扩展create-react-app? [英] How to extend create-react-app?
问题描述
是否可以通过我自己的库,webpack配置,dotfile等扩展精彩的 create-react-app
,但保持最新状态?
我的意思是,我想弹出
,然后根据自己的需要进行抛光,但可以毫不费力地获取最新更新,例如,手动跟踪仓库,查找差异,复制和粘贴等等。
是的,实际上可以!您要做的是分叉,修改和发布 react-scripts
并在使用 create-react-app $ c $进行脚手架安装时引用它们c>:
$ create-react-app my-app --scripts-version react-scripts-fork
它可能是 custom-react-scripts
已经实现了您要查找的内容,即SASS或装饰器。 此处是有关的文章自定义反应脚本
和此处是软件包。
Is there a way to extend wonderful create-react-app
with my own libs, webpack configs, dotfiles, etc., but keep it up to date?
I mean, I want to eject
it, then polish it to my needs but get the latest updates without big pain, i.e. tracking the repo manually, looking for diffs, copying and pasting and so on.
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
:
$ create-react-app my-app --scripts-version react-scripts-fork
Here you can read more about react-scripts
.
Here is an article about how to fork and modify react-scripts
to your own needs.
It might be that custom-react-scripts
already has implemented what you are looking for, ie SASS or decorators. Here is an article about custom-react-scripts
and here is the package.
这篇关于如何扩展create-react-app?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!