我应该使用webpack还是创建反应应用?

发布于 2025-02-12 14:00:03 字数 76 浏览 0 评论 0原文

我应该使用webpack或创建反应应用来初始化我的React应用程序吗?使用WebPack比Create-React-App有任何优势吗?

Should i use webpack or create-react-app to initialize my react app? Is there any advantage of using webpack over create-react-app?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

将军与妓 2025-02-19 14:00:03

创建React App摘要,除非弹出,否则配置不允许您更改它。
使用WebPack确实需要WebPack知识,并且确实可以完全控制您的环境。

CRA最适合您不需要更改设置的项目,如果您需要控制并且需要更改内容,则最好使用WebPack。

Create react app abstracts the configuration does not allow you change it unless you eject.
Using webpack does require knowledge of webpack and does allow complete control over your environment.

CRA is best suited for projects where you the requirements does not need you to change settings , if you need control and need to change things it is best to use Webpack.

若水微香 2025-02-19 14:00:03

,它使用配置(例如)将typecript转换为javaScript,捆绑sass,少文件,捆绑svg文件等

首先, webpack是一种构建工具 是一种反应样板,在引擎盖下使用 babel和webpack,已经为最常见的方案提供了配置,因此您不必担心 它。

从您的问题中不清楚,初始化的意思是什么。我只能假设您的意思是用中等简单的学习曲线引导应用程序。如果是这种情况,CRA是必经之路。

First, Webpack is a build tool, which uses configuration to (as an example) transpile Typescript to JavaScript, bundle SASS, LESS files, bundle SVG files etc.

Create React App is a React boilerplate that uses Babel and Webpack under the hood, with configurations already in place for the most common scenarios, so you don't have to worry about it.

It is not clear from your question, what initialization means. I can only assume that you mean to bootstrap an application with a moderately easy learning curve. If that is the case, CRA is the way to go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文