Nuxt3 怎么修改端口号 port


只需要修改 package.json 文件的 dev 脚本命令,在后面添加 --port=3002 即可,例如:


            {
                "scripts": {
                  "build": "nuxt build",
                  "dev": "nuxt dev --port=3002",//在这修改端口号
                  "generate": "nuxt generate",
                  "preview": "nuxt preview"
                },
                "devDependencies": {
                  "nuxt": "3.0.0-rc.8"
                }
              }
        

back home