Smallweb Embed
This package provide a simple way to embed assets in your smallweb application.
Usage
Use the cli to embed assets in your app:
deno run -A jsr:@smallweb/embed frontend/dist dist
Then, from your app, you can import the assets from the generated module:
import embeds from "./dist/mod.ts"; // serve the static assets from the frontend/dist directory function handler(req: Request) { return embeds.serve(req); } export default { fetch: handler, }
TODO
- ETag support
Add Package
deno add jsr:@smallweb/embed
Import symbol
import * as embed from "@smallweb/embed";
Import directly with a jsr specifier
import * as embed from "jsr:@smallweb/embed";