panel.command.compile module#

class panel.command.compile.Compile(parser: ArgumentParser)[source]#

Bases: Subcommand

Subcommand to generate a new encryption key.

invoke(args)[source]#

Takes over main program flow to perform the subcommand.

This method must be implemented by subclasses. subclassed overwritten methods return different types: bool: Build None: FileOutput (subclassed by HTML, SVG and JSON. PNG overwrites FileOutput.invoke method), Info, Init, Sampledata, Secret, Serve, Static

Args:

args (argparse.Namespace) : command line arguments for the subcommand to parse

Raises:

NotImplementedError

name: ClassVar[str] = 'compile'#

name for this subcommand

panel.command.compile.run_compile(bundles: dict[Path, list[type[ReactiveESM]]], build_dir: str | PathLike | None = None, unminified: bool = False, skip_npm: bool = False, file_loaders: list[str] | None = None, verbose: bool = False) int[source]#

Runs the compile command on the provided bundles.

Parameters:
bundlesdict[type[ReactiveESM]]

A list of ReactiveESM component classes to compile.

build_dirstr | os.PathLike, optional

The directory where the build output will be saved. If None, a temporary directory will be used.

unminifiedbool, optional

If True, minifies the compiled JavaScript bundle.

skip_npm: bool

Whether to skip npm install (assumes build_dir is set)

file_loaders: list[str]

List of file types (e.g. woff2 or svg) loaders to carry along

verbosebool, optional

If True, prints detailed logs during the compilation process.

Returns:
int:

Count of errors.