React
1.默认项目结构
my-app/
README.md
#依赖
node_modules/
#打包即配置文件
package.json
.gitignore
#`npm run build` 命令后 打包存放的目录
public/
favicon.ico
index.html
#指定了开始页面 index.html
manifest.json
#自己开发的项目文件
src/
App.css
#入口类文件
App.js
App.test.js
index.css
index.js
logo.svg
2.我的项目结构
create-react-app
+ react+antd-mobile
my-app/
README.md
#依赖
node_modules/
#打包即配置文件
package.json
.gitignore
#`npm run build` 命令后 打包存放的目录
public/
favicon.ico
index.html
#指定了开始页面 index.html
manifest.json
#自己开发的项目文件
src/
#接口相关
api
#跟域名访问的目录
components
#配置文件
config
#图片
images
#每个页面的路径
pages
#样式
style
#存放一些公用方法
utils
#入口文件
App.js
App.test.js
index.css
index.js
logo.svg
#缓存资源到本地,提升应用的访问速度
registerServiceWorker.js
#路由文件
router.js
#webpack 配置
config-overrides.js
3.package.json修改
添加"homepage"
: "https://m.huhustory.com"
添加"dependencies"
"dependencies": {
"antd-mobile": "^2.2.2",
"axios": "^0.18.0",
"callapp-lib": "^1.7.2",
"copy-to-clipboard": "^3.0.8",
"js-cookie": "^2.2.0",
"react": "^16.4.1",
"react-document-title": "^2.0.3",
"react-dom": "^16.4.1",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4",
"weixin-js-sdk": "^1.4.0-test"
}
添加"scripts"
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
}