如何扩展create-react-app? [英] How to extend create-react-app?

查看:66
本文介绍了如何扩展create-react-app?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过我自己的库,webpack配置,dotfile等扩展精彩的 create-react-app ,但保持最新状态?



我的意思是,我想弹出,然后根据自己的需要进行抛光,但可以毫不费力地获取最新更新,例如,手动跟踪仓库,查找差异,复制和粘贴等等。

解决方案

是的,实际上可以!您要做的是分叉,修改和发布 react-scripts 并在使用 create-react-app

  $ 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆