Readme

ReloadScript: Reload HTML pages on new versions a val or its dependencies

Setup

  1. Fork this val
  2. Include ReloadScript(import.meta.url) in your HTML output

Example

import { htmlResponse } from "https://esm.town/v/postpostscript/htmlComponentLibrary"; import { ReloadScript } from "https://esm.town/v/[username]/ReloadScript"; export default async function(req: Request): Promise<Response> { return htmlResponse` It worked!!! ${Math.random()} ${ReloadScript(import.meta.url)} `; }

Todo

  • use import list to pare down dependency list and prevent unnecessary reloads

forked from @stevekrouse/ReloadScript

Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
March 1, 2024