ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Live​Server

by molnarmark ST3

🌍️ Launch a Development Server directly from Sublime Text

Details

Installs

  • Total 44K
  • Win 34K
  • Mac 4K
  • Linux 6K
Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10
Windows 13 36 30 27 38 37 46 27 26 45 38 37 36 33 33 38 41 44 50 37 36 26 52 36 31 45 45 34 32 33 36 32 43 33 43 27 36 30 34 39 31 43 40 20 36 28
Mac 0 3 2 2 4 2 5 2 5 5 10 4 9 2 5 4 5 4 4 5 5 6 3 4 4 9 7 8 5 4 7 6 5 2 8 3 7 5 5 2 5 5 7 6 3 3
Linux 3 2 12 5 9 2 6 4 7 11 6 5 13 7 2 4 8 7 6 8 6 6 4 6 9 8 5 7 7 7 8 5 7 7 9 2 5 2 6 6 6 14 6 8 8 7

Readme

Source
raw.​githubusercontent.​com

Launch a Development Server directly from Sublime Text!

📋 Introduction

This package integrates the Live Server Node package, giving the ability to launch a local development server to serve content directly from Sublime Text.

💡 About Live Server:

Live Server is Node.js tool that spins up a local development server in the given directory.

It features live browser reloading, which simply means that your browser will automatically refresh the page when any change is made to your HTML & CSS files.

Useful for static sites, SPAs, and general HTML/CSS fiddling.

❗Prerequisites

You need the following software installed to use Live Server.

To install Live Server globally using npm, run:

npm install -g live-server

To install Live Server globally using Yarn, run:

yarn global add live-server

🌀 Installation

Package Control

This package is available in Package Control under the name LiveServer.

As a Repository

❓ Usage

This package exposes 3 commands that can be used directly via the Command Palette, or bound to keys. These are:

Live Server: Start

  • Maps to live_server_start

Live Server: Stop

  • Maps to live_server_stop

Live Server: Open In Browser

  • Maps to live_server_open_in_browser

Status bar messages with indicator emojis are implemented into the package, displaying information in cases such as:

  • 🎉 Live Server running
  • ❌ Live Server stopped
  • ✔️ Live Server status

When the development server is running, a status message will be shown in the status bar indicating that the server is running. This is shared across all views in the opened instance.

🔨 Settings

To change your settings, bring up the Command Palette and select: Preferences: Live Server Settings

The default settings are the following:

// Note: These are just mappings to https://github.com/tapio/live-server#usage-from-command-line
{
  "node_executable_path": "/usr/bin/node",
  "global_node_modules_path": "/usr/local/lib/node_modules",
  "port": 8080,
  "address": "localhost",
  "cors": true,
  "browser": "default",
  "nobrowser": false,
  "wait": 100
}

node_executable_path

  • Path to the Node runtime executable. You can run whereis node in your terminal to find this.
  • ##### default: /usr/bin/node

global_node_modules_path

  • Path to the default node_modules directory. You can run npm root -g** or **yarn global bin in your terminal to find this.
  • ##### default: /usr/local/lib/node_modules

port

  • The default port for the server.
  • ##### default: 8080

address

  • Host address. This should always be either localhost or 127.0.0.1.
  • ##### default: localhost

cors

  • Enables CORS for any origin.
  • ##### default: true

browser

  • Specifies which browser to use.
  • Valid values are:

    • default
    • google-chrome
    • firefox
  • default: default

nobrowser

  • By setting this to true, the browser will not open the server by default
  • ##### default: false

wait

  • Wait this amount of milliseconds before reloading the page after a change
  • ##### default: 100

🔖 Credits