yandeu / five-server-vscode

⚑ VSCode Extension for Five Server.
https://marketplace.visualstudio.com/items?itemName=yandeu.five-server
Other
121 stars 9 forks source link

Five Server

A better live server

VERSION Visual Studio Marketplace Rating GitHub Sponsors

demo

Get Started

4 ways to start your live server.

  1. Click Go Live in the Status Bar (bottom of VSCode)
  2. Right-Click a Open File > Open with Five Server
  3. Right-Click a File in the Explorer > Open with Five Server
  4. Right-Click a Folder in the Explorer > Open with Five Server (root)
    (will set the current folder as root until you stop the server)

Videos

Quick Test

Something is not working? Try the simple setup below:

<!DOCTYPE html>
<html>
  <head>
    <title>HTML Test File</title>
  </head>
  <body>
    <h1>It works!</h1>
  </body>
</html>

The setup above works but your project not?

About PHP

Although Five Server can render, display and live reload PHP, it does not provide a full PHP server. If you want to develop a big PHP app, you manually have to link the client-side Five Server script with your PHP files. See five-server-with-php.

Features

πŸ’‘ Most advanced features are disabled by default.
Turn them on in the settings or by configuring a fiveserver.config.js file in the root of your workspace.

Note:

Config File Example:

// fiveserver.config.js
module.exports = {
  highlight: true, // enable highlight feature
  injectBody: true, // enable instant update
  remoteLogs: true, // enable remoteLogs
  remoteLogs: "yellow", // enable remoteLogs and use the color yellow
  injectCss: false, // disable injecting css
  navigate: true, // enable auto-navigation
};

More Docs

Known Issues

<script>
  const main = () => {
    console.log("Some JavaScript Code...");
  };

  // wait for five-server to connect
  const five = document.querySelector('[data-id="five-server"]');
  if (five) five.addEventListener("connected", main);
  else window.addEventListener("load", main);
</script>

Debug Mode

Need to debug something? Set debugVSCode to true.

// fiveserver.config.js
module.exports = {
  debugVSCode: true,
};

Release Notes

No release notes while < v1.0.0

Support Five Server

GitHub Sponsors
One-Time Donation