如何从包脚本启动和构建运行gulp命令

问题描述 投票:0回答:1
  1. 嗨,我需要通过npm start运行gulp命令。
  2. 当我用命令运行gulp它正在工作但我需要通过npm start或ng build命令自动运行命令

的package.json

{
  "name": "cfch",
  "version": "0.0.0",
  "main": "gulpfile.js",
  "scripts": {
    "ng": "ng",
    "start": "gulp && ng serve --proxy-config proxy.conf.json", //it's working
    "build": "gulp && ng build --prod–aot && tar -zcvf archive.tar.gz dist/prod/*", //not working while type command ng build
    "test": "echo \"Error: no test specified\" && exit 1",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "gulp": "gulp"
  },
   "dependencies": {
    "gulp-htmlmin": "^5.0.1",
    "gulp-imagemin": "^5.0.3",
    "gulp-minify-css": "^1.2.4",
    "gulp-uglify": "^3.0.1",
},
  "devDependencies": {
    "gulp": "^3.9.1",
}
angular gulp
1个回答
1
投票

您可以将gulp安装为Dev依赖项。然后添加gulp命令以&&开头。举个例子

“开始”:“gulp <command> && serve”

© www.soinside.com 2019 - 2024. All rights reserved.