The plugin Bundler is disabled by default so to enable it you have to import
and use it in the
import bundler from "lume/plugins/bundler.ts"; site.use(bundler());
This plugin load
including all dependencies of the input. Internally uses the
bundle Deno tool.
You can configure the bundler plugin with the following options:
extensions: Array with the extensions of the files that this plugin will handle. By default is
[".js", ".ts"]. If you want to bundle a
Reactapp you should include also
trueto generate a source map file that will be saved in the same place but with the
.mapextension appended. For example, the file
my/script.jswill generate the sourcemap file
options: The options available in
entries: Use this option to bundle your scripts and all dependencies to a single file. This array contains the entry files that you want to bundle. To use this option, you must set
options.bundleto "module" or "classic".
.ts files to run in the browser, use a triple slash reference to
include helpful libraries, like
dom in your scripts. For example,
/// <reference lib="dom" /> document.getElementById("foo");
This will help Deno and your code editor to Bundle into JS appropriately.