简体   繁体   English

我需要在 2021 年在 React 项目中手动设置 babel 和 webpack

[英]do I need setup babel and webpack manually in 2021 in react project

I have created a new project with npx create-react-app command, does this command automatically install and configure babel and webpack for me or do I have to do it manually.我用npx create-react-app命令创建了一个新项目,这个命令是自动为我安装和配置 babel 和 webpack 还是我必须手动完成。 I have read an instruction on this link https://create-react-app.dev/docs/available-scripts/ .我已阅读此链接https://create-react-app.dev/docs/available-scripts/上的说明。 I think what it is saying that I don't need to configure babel or webpack, npm run build command does all for me.It would be super useful if you explain in a beginner-friendly way.我认为我不需要配置 babel 或 webpack, npm run build命令为我完成了所有工作。如果您以初学者友好的方式解释它将非常有用。 Thank you for your answers.谢谢您的回答。

Don't need.不需要。 Because Babel and Webpack are already dependent on React-Scripts, these dependencies are installed by default因为 Babel 和 Webpack 已经依赖 React-Scripts,所以默认安装这些依赖

create-react-app provides some default configurations.You can use the following commands to manipulate and display the configuration create-react-app 提供了一些默认配置,可以使用以下命令来操作和显示配置

npm run eject

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM