React 应用构建指南

本指南介绍如何使用 Create React App 构建 React 应用。

项目启动

在项目目录下,执行以下命令启动开发服务器:

npm start

该命令会在浏览器中打开应用,并支持实时重新加载。控制台会显示代码检查结果。

测试

执行以下命令运行测试:

npm test

该命令会启动交互式监视模式,方便进行测试。

生产环境构建

执行以下命令构建生产环境代码:

npm run build

该命令会将代码打包到 build 文件夹中,并进行优化以提升性能。

依赖项移除

执行以下命令移除 eject 依赖项:

npm run eject

注意: 该操作不可逆。

移除 eject 后,将无法使用 Create React App 提供的默认配置。

总结

本指南介绍了使用 Create React App 构建 React 应用的基本步骤。更多信息,请参考官方文档。

zip
country-map-master.zip 预估大小:44个文件
folder
country-map-master 文件夹
file
.eslintcache 3KB
folder
public 文件夹
file
manifest.json 492B
file
index.html 2KB
file
robots.txt 67B
file
favicon.ico 4KB
file
logo512.png 9KB
file
logo192.png 5KB
folder
src 文件夹
folder
utils 文件夹
file
slidersImgs.js 4KB
file
logo.svg 3KB
file
index.css 818B
folder
components 文件夹
folder
Slider 文件夹
file
style.js 1KB
file
index.js 931B
folder
Modal 文件夹
file
Modal.js 291B
file
style.js 857B
folder
Map 文件夹
file
style.js 734B
file
index.js 62KB
folder
assets 文件夹
folder
img 文件夹
folder
dolnoslaskie 文件夹
file
3.png 376KB
file
1.png 271KB
file
2.png 259KB
file
country_map_clear.svg 26KB
folder
podkarpackie 文件夹
file
3.png 276KB
file
1.png 273KB
file
2.png 264KB
folder
lubelskie 文件夹
file
3.png 344KB
file
1.png 250KB
file
2.png 213KB
file
POL_location_map.svg 48KB
folder
mazowieckie 文件夹
file
3.png 271KB
file
1.png 210KB
file
2.png 230KB
file
App.js 166B
file
index.js 285B
file
helperStyle.js 540B
folder
.idea 文件夹
file
misc.xml 367B
file
country-map.iml 344B
folder
inspectionProfiles 文件夹
file
Project_Default.xml 251B
file
modules.xml 281B
file
.gitignore 250B
file
prettier.xml 181B
file
vcs.xml 172B
file
README.md 3KB
file
.gitignore 310B
file
package-lock.json 774KB
file
package.json 1KB
zip 文件大小:3.41MB