2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Nuxt.jsをHerokuへデプロイする手順

Last updated at Posted at 2018-11-27

事前準備

  • Nuxt.jsインストール
  • git導入

アカウント作成

Heroku Sign up

Heroku Toolbeltの導入

コマンドにて

brew install heroku/brew/heroku

Herokuへログイン

heroku login

heroku上にアプリを作成

heroku create

herokuへデプロイ

git push heroku master

.envがある場合は、herokuへ反映

heroku plugins:install heroku-config
heroku config:push

Nuxt.jsのデプロイに必要な設定

heroku config:set NPM_CONFIG_PRODUCTION=false
heroku config:set HOST=0.0.0.0
heroku config:set NODE_ENV=production
package.json
"scripts": {
    "dev": "nuxt",
    ...
    "heroku-postbuild": "npm run build"
},

heroku に npm run build を実行してもらうために "heroku-postbuild": "npm run build" を追記

作成したアプリを開く

heroku open

ログ確認

heroku logs --tail

アプリの更新

git push heroku master
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?