React 应用创建与部署指南

本指南介绍如何使用 Create React App 创建 React 应用,并涵盖开发、测试和部署的流程。

开发环境

使用 yarn start 命令启动开发服务器,该服务器会在浏览器中打开应用,并支持实时重新加载和错误提示。

测试

使用 yarn test 命令启动交互式测试运行程序。

生产构建

使用 yarn build 命令创建应用的生产构建版本。该命令会将 React 代码进行打包、优化,并生成部署所需的文件。

项目配置

如果需要更高级的配置,可以使用 yarn eject 命令移除 Create React App 的默认配置,以便进行自定义设置。请注意,此操作不可逆。

命令说明

  • yarn start:启动开发服务器
  • yarn test:运行测试
  • yarn build:创建生产构建版本
  • yarn eject:移除默认配置
zip
diplom-master.zip 预估大小:59个文件
folder
diplom-master 文件夹
folder
config 文件夹
file
modules.js 3KB
file
getHttpsConfig.js 2KB
file
webpackDevServer.config.js 7KB
file
webpack.config.js 32KB
folder
jest 文件夹
file
cssTransform.js 314B
file
fileTransform.js 1KB
file
pnpTs.js 620B
file
env.js 4KB
file
paths.js 2KB
file
package.json 2KB
file
.eslintcache 2KB
folder
src 文件夹
file
serverWorker.js 4KB
file
index.js 440B
folder
assets 文件夹
folder
img 文件夹
file
pizza-logo.svg 6KB
file
arrow-top.svg 490B
file
grey-arrow-left.svg 222B
file
empty-cart.png 25KB
file
cart.svg 1KB
file
trash.svg 1KB
file
plus.svg 686B
folder
components 文件夹
file
index.js 193B
file
Header.jsx 2KB
file
Button.jsx 354B
file
Categories.jsx 669B
file
SortPopup.jsx 2KB
file
App.js 12KB
folder
scss 文件夹
file
_fonts.scss 2KB
folder
fonts 文件夹
file
ProximaNova-Black.woff 49KB
file
ProximaNova-Extrabld.eot 127KB
file
ProximaNova-Bold.eot 127KB
file
ProximaNova-Regular.woff 51KB
file
ProximaNova-Black.eot 125KB
file
ProximaNova-Semibold.woff 51KB
file
ProximaNova-Extrabld.ttf 126KB
file
ProximaNova-Semibold.eot 128KB
file
ProximaNova-Black.ttf 124KB
file
ProximaNova-Regular.eot 128KB
file
ProximaNova-Semibold.ttf 128KB
file
ProximaNova-Extrabld.woff 50KB
file
ProximaNova-Regular.ttf 128KB
file
ProximaNova-Bold.woff 51KB
file
ProximaNova-Bold.ttf 127KB
file
app.scss 5KB
file
_variables.scss 121B
folder
components 文件夹
file
_sort.scss 901B
file
_categories.scss 531B
file
_header.scss 430B
file
_pizza-block.scss 1KB
file
_all.scss 107B
file
_button.scss 2KB
folder
libs 文件夹
file
_normalize.scss 929B
file
.gitignore 416B
folder
public 文件夹
file
logo192.png 5KB
file
manifest.json 492B
file
robots.txt 67B
file
index.html 2KB
file
logo512.png 9KB
file
favicon.ico 4KB
file
README.md 3KB
...
zip 文件大小:845.33KB