react-app-rewired 修改 react 项目默认端口号

2022-05-13 15:03:27 浏览数 (1)

package.json

设置: "dev": "PORT=8888 react-app-rewired start"

如下:

代码语言:javascript复制
{
  "name": "arco-design-pro",
  "version": "1.0.0",
  "description": "Arco Design Pro",
  "scripts": {
    "start": "react-app-rewired start",
    "dev": "PORT=8888 react-app-rewired start",
    "build": "react-app-rewired build",
    "eject": "react-scripts eject",
    "eslint": "eslint src/ --ext .ts,.tsx,.js,.jsx --fix --cache",
    "stylelint": "stylelint 'src/**/*.less' 'src/**/*.css' --fix --cache",
    "pre-commit": "pretty-quick --staged && npm run eslint && npm run stylelint",
    "prepare": "husky install && husky add .husky/pre-commit 'npm run pre-commit'"
  }
}

0 人点赞