问题描述
我用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
您会发现脚本对象正在使用库反应脚本
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/scripts 和 react-scripts/config 文件夹包含所有Webpack配置.
This react-scripts/scripts and react-scripts/config folder contains all the webpack configurations.
这篇关于create-react-app webpack的配置和文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!