LoginSignup
0

More than 5 years have passed since last update.

メモ > npm install -g gh-pages

Last updated at Posted at 2018-12-14

yarn build としたら、ビルド結果に以下のように表示された。

The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:

  "homepage" : "http://myname.github.io/myapp",

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

Find out more about deployment here:

  http://bit.ly/2vY88Kr

package.json に以下を追加した。

"homepage" : "http://username.github.io/myapp",

次のビルドではさらにアドバイスが

  yarn add --dev gh-pages

Add the following script in your package.json.

    // ...
    "scripts": {
      // ...
      "predeploy": "npm run build",
      "deploy": "gh-pages -d build"
    }

Then run:
  yarn run deploy

Find out more about deployment here:
  http://bit.ly/2vY88Kr

というわけでpackage.jsonに以下を追加

"predeploy": "npm run build",
"deploy": "gh-pages -d dist"

※dist はビルドした結果が作成されるフォルダ名

gh-pagesコマンド

gh-pages コマンドが入ってなかったのでインストールする。

npm install -g gh-pages

deploy

yarn deploy

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
0