ποΈ Launch a Development Server directly from Sublime Text
This package integrates the Live Server Node package, giving the ability to launch a local development server to serve content directly from Sublime Text.
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.
You need the following software installed to use Live Server.
Node.js
npm
or Yarn
Live Server
installed globallyTo 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
This package is available in Package Control under the name LiveServer.
Package Control: Add Repository
This package exposes 3 commands that can be used directly via the Command Palette, or bound to keys. These are:
Live Server: Start
live_server_start
Live Server: Stop
live_server_stop
Live Server: Open In Browser
live_server_open_in_browser
Status bar messages with indicator emojis are implemented into the package, displaying information in cases such as:
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.
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
whereis node
in your terminal to find this.default: /usr/bin/node
global_node_modules_path
npm root -g
or yarn global bin
in your terminal to find this.default: /usr/local/lib/node_modules
port
default: 8080
address
default: localhost
cors
default: true
browser
Specifies which browser to use.
Valid values are:
default
google-chrome
firefox
default: default
nobrowser
default: false
wait
default: 100
Node
package also called Live Server by Tapio Vierros.