create-react-app webpack 配置和文件在哪里? [英] where is create-react-app webpack config and files?

查看:34
本文介绍了create-react-app webpack 配置和文件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 create-react-app 包创建了一个 ReactJS 项目并且运行良好,但我找不到 webpack 文件和配置.

I create a ReactJS project with the create-react-app package and that worked well, but I cannot find webpack files and configurations.

react-create-app 如何与 webpack 配合使用?create-react-app 的默认安装中的 webpack 配置文件在哪里?我在我的项目文件夹中找不到配置文件.

How does react-create-app work with webpack? Where are the webpack configuration files located in a default installation with create-react-app? I'm unable to find configuration files in my project's folders.

我还没有创建覆盖配置文件.我可以使用其他文章管理配置设置,但我想找到常规配置文件.

I have not created an override config file. I can manage config settings with other articles but I want to find the conventional config file(s).

推荐答案

如果您想查找 webpack 文件和配置,请转到您的 package.json 文件并查找 脚本

If you want to find webpack files and configurations go to your package.json file and look for scripts

您会发现脚本对象正在使用一个库 react-scripts

You will find that scripts object is using a library react-scripts

现在转到 node_modules 并查找 react-scripts 文件夹 react-script-in-node-modules

Now go to node_modules and look for react-scripts folder react-script-in-node-modules

这个 react-scripts/scriptsreact-scripts/config 文件夹包含所有的 webpack 配置.

This react-scripts/scripts and react-scripts/config folder contains all the webpack configurations.

这篇关于create-react-app webpack 配置和文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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