Workers

Scripts can be compiled with the bultin compileWorker() method:

Generator.compileWorker(name, src, options, buildOptions);

This works similar to the compileScript() method but with some differences:

  • The script is written directly to outputFolder instead of assetFolder (i.e. to the web root).
  • The output filename does not include a hash.
name: string
Unique name for this script. Used when referencing the script and as the base of the output filename.
src: string
Path to the script entrypoint.
buildOptions: object Optional

Options passed to esbuild.

format: "iife" | "cjs" | "esm" Optional
Output format.
define: Record<string, string> Optional
Global identifiers to replace.

Search

Esc to close Arrow up/down to navigate Enter to select

Select version

Please wait, loading version data...