日常生活的交流与学习

首页 新随笔 联系 管理

一个命令相当于执行两个命令

{
  "name": "npm-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    // 直接就是在npm start,可以就是先npm i,然后在npm run serve
    "start": "npm run install-missing-dependencies && npm run serve",
    "install-missing-dependencies": "npm i",
    "serve": "http-server"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "http-server": "^14.1.0"
  }
}
  1. 关键代码:
// 直接就是在npm start,可以就是先npm i,然后在npm run serve
    "start": "npm run install-missing-dependencies && npm run serve",
    "install-missing-dependencies": "npm i",
posted on 2023-05-17 20:51  lazycookie  阅读(32)  评论(0编辑  收藏  举报