Gulp任务停止了在Heroku上的部署

时间:2020-01-04 12:41:50

标签: heroku gulp

我只有一个简单的静态项目,仅一页,并且我正在使用Gulp编译CSS/JS。我不想在GitHub中推送dist文件夹,我希望Heroku构建此文件。

我的项目是这样的:

-dist
-node_modules
-src 
  -fonts
  -img
  -js
  -sass
.gitignore
gulpfile.js
index.html
package-lock.json
package.json
static.json

我遵循了同样的技巧 Gulp deploy dist folder of Node app to Heroku,但我尚无信誉以添加评论并提出一些问题。我遵循了以下步骤:

1-创建的static.json文件

{
  "root": "dist/",
  "clean_urls": true,
  "routes": {
      "/**": "index.html"
  }
}

2-我在package.json

中指定了dist文件夹的构建
  "scripts": {
     "start": "node app",
     "heroku-postbuild": "gulp"
  }

但是,当Heroku尝试部署软件包时,该过程将停止在gulp构建任务中...

-----> Node.js app detected

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false

-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)

       Resolving node version 12.x...
       Downloading and installing node 12.14.0...
       Using default npm version: 6.13.4

-----> Restoring cache
       - node_modules

-----> Installing dependencies
       Installing node modules (package.json + package-lock)
       audited 10671 packages in 5.738s

       3 packages are looking for funding
         run `npm fund` for details

       found 0 vulnerabilities


-----> Build
       Running heroku-postbuild

       > heroku-postbuild /tmp/build_7c935548f7f3896136e4e0418c8f0615
       > gulp

       [11:31:42] Using gulpfile /tmp/build_7c935548f7f3896136e4e0418c8f0615/gulpfile.js
       [11:31:42] Starting 'default'...
       [11:31:42] Starting 'cleanFolder'...
       [11:31:42] Finished 'cleanFolder' after 22 ms
       [11:31:42] Starting 'html'...
       [11:31:42] Starting 'css'...
       [11:31:42] Starting 'js'...
       [11:31:42] Starting 'copy'...
       [11:31:43] Finished 'html' after 157 ms
       [11:31:43] Finished 'css' after 158 ms
       [11:31:43] Finished 'js' after 159 ms
       [11:31:43] Finished 'copy' after 221 ms
       [11:31:43] Finished 'default' after 247 ms 

0 个答案:

没有答案