LoginSignup
5
1

More than 1 year has passed since last update.

Nuxt.js 三目並べ (tic-tac-toe) をNetlifyにデプロイするまで

Posted at

三目並べ (tic-tac-toe)

三目並べ - Wikipedia
ふと思い立ってNuxt.jsの手習いにゲームでも触りたいなと思った。
この記事のゴール: practice-nuxt-tic-tac-toe

材料

上記を発見。感謝。

npm install
npm run dev
http://localhost:3030/

途中以下エラーが出た。

 ERROR  in ./store/index.js                                                                   friendly-errors 04:19:19

Module Error (from ./node_modules/eslint-loader/dist/cjs.js):                                 friendly-errors 04:19:19

C:\git\practice-nuxt-tic-tac-toe\store\index.js
   1:24  error  Delete `␍`  prettier/prettier
   2:26  error  Delete `␍`  prettier/prettier
   3:1   error  Delete `␍`  prettier/prettier
   4:28  error  Delete `␍`  prettier/prettier
   5:26  error  Delete `␍`  prettier/prettier
   6:13  error  Delete `␍`  prettier/prettier
   7:19  error  Delete `␍`  prettier/prettier
   8:7   error  Delete `␍`  prettier/prettier
   9:17  error  Delete `␍`  prettier/prettier
  10:29  error  Delete `␍`  prettier/prettier
  11:29  error  Delete `␍`  prettier/prettier

package.json について --fix を付加した。

package.json
    "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore . --fix",

参考

prettier の End of Line のデフォルト値が lf なのに対して、コード内に crlf が含まれているため。

npm run lint

なるほど。これで手元の http://localhost:3030/ にて動作する。

image.png

デプロイ

折角なのでnetlifyにデプロイしてみる。
Page Not Found が出現したがリダイレクトの設定を施す。参考

Completed

practice-nuxt-tic-tac-toe

参考

【エラー解決方法】Delete eslint(prettier/prettier) - Qiita
STRIP
Nuxt.js + Netlifyで404 Not Foundをトップページにリダイレクト - モンモンブログ

本題とずれるが、これも便利そう: commitlint - Lint commit messages
とほほさん: https://www.tohoho-web.com/ex/vuejs.html

以上です~

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