LoginSignup
3
3

More than 5 years have passed since last update.

vue-cliでつくったやつをGitHub Pagesに公開

Posted at

config/index.jsを編集

assetsPublicPath: '/' →  assetsPublicPath: ''

詳しくはこっちに
https://qiita.com/tiwu_official/items/43dc554ec43dd951812a

config/index.js
'use strict'
// Template version: 1.2.5
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
  dev: {
     // 省略
  },

  build: {
    // 省略

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '', ここ

    // 省略
  }
}

ビルド

npm run build

distをgh-pagesブランチにプッシュ

git subtree push --prefix dist/ origin gh-pages

参考ページ

vue-cliでwebアプリケーションを作って、GitHubPagesで無料で爆速でリリースした話

3
3
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
3
3