文章加密

;

2020年6月2日 星期二

deploy GitPage, add remote, change remote

https://cli.vuejs.org/guide/deployment.html#pwa (手動佈署)
手動佈署:

  1. 先在vue.config.js裡加上下列程式
  2. module.exports = {
  3.   publicPath: process.env.NODE_ENV === 'production'
  4.     ? '/my-project/'
  5.     : '/'
  6. }

  7. 執行build之後,把要呈現的檔案放上gh-pages分支


自動佈署:
  1. 建立gh-pages分支,把打包好的檔案放入
  2. If you are using Vue CLI along with a backend framework that handles static assets as part of its deployment, all you need to do is make sure Vue CLI generates the built files in the correct location, and then follow the deployment instruction of your backend framework.

    If you are developing your frontend app separately from your backend - i.e. your backend exposes an API for your frontend to talk to, then your frontend is essentially a purely static app. You can deploy the built content in the dist directory to any static file server, but make sure to set the correct publicPath.

    需要做幾個步驟,見下面網址
  3. https://cli.vuejs.org/guide/deployment.html#github-pages


$ git remote add origin https://github.com/user/repo.git
# Set a new remote
$ git remote set-url origin https://github.com/user/repo.git
# Set a change remote

沒有留言:

張貼留言