日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

创建react项目

發(fā)布時間:2024/9/27 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 创建react项目 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

安裝流程

【注意】:在Git Bush Here中創(chuàng)建,因為eject只有在線上倉庫的時候才可以開啟配置環(huán)境

1, 創(chuàng)建項目:
- js的 npx create-react-app 項目名稱
- ts的 npx create-react-app 項目名稱 template --typescript (之后安裝路由的配置也不一樣)
2,cd 到當(dāng)前目錄
3,git add --all
4, git commit -m ‘提交’
git status 可以查看狀態(tài)
5, yarn eject 開啟配置環(huán)境
6, 安裝sass:
yarn add node-sass-chokidar(正常情況下也可能失敗,多安裝幾次即可)
yarn add npm-run-all
7,修改package.json文件中的 script配置
“scripts”: {
“build-css”: “node-sass-chokidar src/ -o src/”,
“watch-css”: “npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive --use-polling --polling-interval 1000”,
“start-js”: “node scripts/start.js”,
“start”: “npm-run-all -p watch-css start-js”,
“build-js”: “node scripts/build.js”,
“build”: “npm-run-all build-css build-js”,
“test”: “node scripts/test.js --env=jsdom”
},
8,項目安裝完畢 yarn start打開項目

總結(jié)

以上是生活随笔為你收集整理的创建react项目的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。