2014-06-18 38 views
0

我已經管理讓我的早午餐建立在Heroku上。 但是,我的快遞顯示Cannot GET /導航到該網站時。Brunch + Heroku build`不能GET /`

按下時

從日誌:

 > [email protected] postinstall /tmp/build_13daabc0-9174-41fd-a59e-c2a894c07256 
     > ./node_modules/brunch/bin/brunch build --production 

     18 Jun 08:59:09 - info: compiled 21 files into 3 files, copied 23 in 5200ms 
-----> Caching node_modules directory for future builds 
-----> Cleaning up node-gyp and npm artifacts 
-----> Building runtime environment 
-----> Discovering process types 
     Procfile declares types -> web 

-----> Compressing... done, 11.8MB 
-----> Launching... done, v7 
     http://nameless-fortress-7923.herokuapp.com/ deployed to Heroku 

To [email protected]:nameless-fortress-7923.git 
+ 75f1076...9d2a80b master -> master (forced update) 

的package.json依賴關係:

"dependencies": { 
    "express": "^4.4.3", 
    "passport-http": "^0.2.2", 
    "passport": "^0.2.0", 
    "brunch": "^1.7.14", 
    "javascript-brunch": "^1.7.1", 
    "coffee-script-brunch": "^1.7.3", 
    "css-brunch": "^1.7.0", 
    "stylus-brunch": "^1.7.0", 
    "static-jade-brunch": "^1.7.0", 
    "jade-brunch": "^1.5.1", 
    "uglify-js-brunch": "^1.7.7", 
    "clean-css-brunch": "^1.7.1" 
    }, 

我的快遞只是擔任了public/(背後的一些認證),恰似this

它成功構建,但它似乎像public/文件夾被Heroku刪除/清除?

任何想法爲什麼發生這種情況將不勝感激。

回答

0

不是一個很好的解決方案,但我的解決方法是簡單地在本地編譯它並將其添加到git。

我在Makefile做了deploy命令,它看起來像這樣

default: run 

run: 
    rm -rf public 
    ./node_modules/brunch/bin/brunch w -s 

deploy: 
    rm -rf public/ 
    rm -rf build/ 
    ./node_modules/brunch/bin/brunch build --production 
    mv public/ build/ 
    git add --all build/ 
    git commit -m "heroku deploy" 
    git push heroku master --force 
    git reset HEAD~1 
    rm -rf build/ 
    heroku open 
0

我從來沒有使用早午餐,但與其他生成工具,它會在構建過程中創建一個dist文件夾。如果該dist文件夾包含在你的gitignore中,它不會被推送到Heroku。

公用文件夾可能會發生同樣的情況。

+0

我有我的'package.json'一個'postinstall'腳本:' 「腳本」:{ 「安裝後」:」。/node_modules/brunch/bin/brunch build --production「 }' – Alex