1
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.

firebase と vue.js 。windows10を添えて。

1
Last updated at Posted at 2019-10-25

firebaseをそろそろ勉強しないと行けない。

・環境を整える
・firebase に デプロイする
・ローカルでデバッグしながらOKだったら デプロイするようにする

参考
https://qiita.com/Satachito/items/4a00b402970d657a88f3
https://www.cresco.co.jp/blog/entry/9035/

node.js を ダウンロードし、インストール

Download | Node.js

フォルダを作り、cd で移動


cd C:\Users\hideki\Dropbox\website\vuetest

パワーシェルをを管理者権限で開く
windows マーク > Windwos PowerShell


npm --version
node --version

最新版になっていればOK!

このエラーがでたら
vue : このシステムではスクリプトの実行が無効になっているため、


Set-ExecutionPolicy RemoteSigned

を入力

firebase tools を インストール


npm install -g firebase-tools
firebase login

chrome が認証ページに飛ぶので認証。

vue.js を インストール


npm install -g @vue/cli
npm install -g @vue/cli-service-global
npm install -g @vue/cli-init

vue init webpack hideki
cd hideki
npm run build//本番用
npm run start//開発用

この時点で
http://localhost:8080

で閲覧可能。

firebaseの初期化


firebase init hosting

以下聞かれたら dist フォルダを設定


What do you want to use as your public directory? dist



 firebase deploy

これで、デプロイされているはず。
https://<Firebase のプロジェクト名>.firebaseapp.com

/vuetest/hideki/package.json


"start": "npm run dev --open",

にしておくと、http://localhost:8080 にアクセスした時、vueファイルを保存するたびに更新してくれるので便利。

1
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
1
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?