11
13

More than 3 years have passed since last update.

VScodeを使って簡単にローカルサーバーを立てる

Posted at

vscode-live-server

VSCodeからボタンひとつでローカルサーバーが立てられる拡張機能です。
https://github.com/ritwickdey/vscode-live-server

良いところ

  1. ボタン一つでお手軽簡単。
  2. hot reloadが有効。

インストール

  1. VSCodeExtensionsからLive Serverで検索
  2. installを押す

使い方

  1. 右下にGo Liveのボタンが増えるので、立ち上げたいhtmlVSCodeで開いてGo Liveを押す
  2. ローカルサーバーが立ち上がる

設定

  • liveServer.settings.root
    • デフォルトは/
    • index.htmlがルートにない場合(例:/src/index.html)デフォルトのままだとjsファイルやcssファイルの参照が404になってしまうので、よしなに設定(例:./src)してあげる。
  • liveServer.settings.port
    • デフォルトは5500
    • よしなに設定
  • liveServer.settings.https
    • デフォルトはfalse
    • httpsの設定も可能

詳細はこちら
https://github.com/ritwickdey/vscode-live-server/blob/master/docs/settings.md

11
13
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
11
13