Skip to main content
Module

x/cav/assets.ts

A server framework for Deno
Go to Latest
import * as cav from "https://deno.land/x/cav@0.0.24/assets.ts";

Functions

Bundles every bundle.ts(x) or *_bundle.ts(x) file in the folder into an adjacent file with the same name plus a .js suffix, recursively. The bundles will be compiled with libs targeting the browser.

Response factory for serving static assets. Asset resolution uses the provided ServeAssetOptions, the Request is only used for caching headers like ETag etc.

Stops watching an assets directory that was prepared with watchAssets(). If the directory wasn't being watched, this is a no-op. If no location object is provided, all watched directories will be unwatched. If an empty object is provided, "./assets" will be unwatched.

Prepares the assets directory and watches it for changes to the ts(x) bundles or their dependencies. When a change occurs, the bundles will be rebuilt.

Interfaces

Object denoting the location of an assets directory.

Options controlling how assets are found and served.

Options for the watchAssets() function.