Code Monkey home page Code Monkey logo

tvkit's Introduction

TVKit

A proxy server to use a modern dev server in old browsers. "Run SvelteKit on a TV"

TVKit intercepts requests to the other webserver and makes them work in old browsers by injecting polyfills and tries to compile the modern javascript and CSS to code that is compatible with the older browser.

Usage (dev server)

  • Start your vite project as normal
  • Run npx tvkit@latest serve --browser "chrome 50" in another terminal
  • Open http://localhost:3000/ in an old browser to visit your website

tvkit serve

Option Default value Description
[target] http://localhost:5173 The URL of the website that is too new
--port 3000 The port the proxy server is going to run on
--browser The transpilation target (uses browserslist)
--add Override feature. Ex --add "es6-module" forces adding systemjs polyfill
--remove Override feature: Ex --remove fetch forces omitting whatwg-fetch polyfill
--no-css false Disable CSS transpilation
--ssl-cert Path to the SSL certificate for https
--ssl-key Path to the SSL certificate's private key
--help Show message per command. Ex: tvkit serve --help

tvkit adds browser aliases for SmartTV platforms: Example --browser "Tizen 5" is aliased to Chrome 63

Start tvkit & servers at the same time

Use concurrently to start both servers at the same time:

// package.json
"scripts": {
  "dev": "concurrently --kill-others-on-fail \"npm:dev:*\"",
  "dev:vite": "vite dev",
  "dev:tvkit": "tvkit serve --browser \"Tizen 4, WebOS 4\"",

Usage (build)

Experimental feature
Use alternative @vitejs/plugin-legacy if you can.

npx tvkit@latest build path/to/build --out path/to/output --browser "chrome 50"

Technology

Consider funding these projects as they do a lot of the heavy lifting.

tvkit's People

Contributors

bfanger 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.