Code Monkey home page Code Monkey logo

vscode-preview-server's Introduction

vscode-preview-server

Features

This extension provide preview of HTML which execute on web server. When you save files, this extension automatically reload browser or side panel (live preview feature). You can call these features from the context menu or editor menu. The main features are as follows.

  • Preview on side panel (ctrl+shift+p): Open preview of HTML on side panel. With this feature, you can easely check the operation of HTML, CSS and JavaScript.
  • Launch on browser (ctrl+shift+l): Open Web Page on default browser. You can check all operation with web page.
  • Stop the web server (ctrl+shift+s): Stop the web server. This feature can be used only from command palette.
  • Resume the web server (ctrl+shift+r): Resume the web server. This feature can be used only from command palette.
  • show UI Page (ctrl+shift+u): Show UI Page. You can change options at UI page.

feature

Extension Settings

Description

This extension contributes the following settings:

  • previewServer.browsers: Browsers to launch. Even if you do not set this option, default browser launch if the ignoreDefaultBrowser is false. Default setting is null.
  • previewServer.ignoreDefaultBrowser: Controls whether launch default browser or not. Default setting is false.
  • previewServer.isWatchConfiguration: Controls whether resume the Web Server or not, when change settings. Default setting is true.
  • previewServer.port: Port number of the Web Server. If you set null, vscode-preview-server generate random number, and set port as random number. Default setting is 8080.
  • previewServer.proxy: Set proxy. This is usefull when execute web app on another web server. Default setting is "".
  • previewServer.sync: Controls whether synchronized or not. Default setting is true.
  • previewServer.ui: Port number of UI Page. Default setting is 3001.
  • startupProject: Name of startup project. This setting is meaningful only when in the workspace. This value is the name of the folder. When using this workspace and omitting this value, the first folder becomes the startup project Default setting is null.

Simple example

{
    "previewServer.browsers": ["firefox", "chrome"],
    "previewServer.ignoreDefaultBroswer": true,
    "previewServer.port": 9999,
    "previewServer.ui": {
        "port": 3001,
        "weinrePort": 8081
    }
}

Settings with workspace

{
    "previewServer.startupProject": "Product"
}
{
	"folders": [
		{
			"name": "Product",
			"path": "foo"
		},
		{
			"name": "Test",
			"path": "bar"
		}
	],
	"settings": {
		"previewServer.startupProject": "Product"
	}
}

How to build locally

  1. Ensure that you have gulp-cli installed globally using npm i -g gulp-cli.
  2. Run npm install to bring in the dependencies.
  3. Run gulp build to produce i18n files.
  4. Press F5 key to launch extension.

Known Issues

Preview on side panel somethimes don't work with CDN, Link etc.

Acknowledgements

This extension use browsersync. I would like to thank browsersync team for useful work.

Lisence

MIT

vscode-preview-server's People

Contributors

grap3fruit avatar yuichinukiyama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.