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

Posted 东海陈光剑

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了react-app-rewired 修改 react 项目默认端口号相关的知识,希望对你有一定的参考价值。

package.json

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

如下:


  "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'"
  

以上是关于react-app-rewired 修改 react 项目默认端口号的主要内容,如果未能解决你的问题,请参考以下文章

node 和 react-app-rewired 修改 React 打包目录的流程

react-app-rewired的使用备注&&禁止生成.map(对应隐藏源码)

如何将 React-app-rewired 与 Customize-CRA 集成

react-app-rewired start 启动失败报错解决方法

antd中按需加载使用react-app-rewired报错

apache_conf react-app-rewired,添加配置config-overrides.js