0
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 1 year has passed since last update.

Nuxt3 ホットリロードで使用するポートの番号をデフォルトの24678から変更する

Last updated at Posted at 2023-02-16

はじめに

Nuxt3のプロジェクトが複数ある場合などに、デフォルトで設定されたホットリロード用のポート番号が被ってしまうため変更する必要があると思います。
タイトル通りですが、この記事はその変更方法について書いています。

環境

  • Nuxt:3.0.0
  • Vue:3.2.45
  • Vuetify:3.0.2

nuxt.config.tsを修正する

変更は簡単でnuxt.config.tsに下記のように設定を追加します。

nuxt.config.ts
export default defineNuxtConfig({
  vite: {
    server: {
      hmr: {
           port: 24600
      }
    }
  }
})

上記のように設定するとホットリロード用のポート番号が24678から24600に変更されます。

Dockerを使用している方はdocker-compose.ymlファイルなどからポートの設定を変更してください。

参考

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