betty.project.extension.webpack.build module

Perform Webpack builds.

class betty.project.extension.webpack.build.Builder[source]

Bases: object

Build Webpack assets.

__init__(working_directory_path: Path, entry_point_providers: Sequence[EntryPointProvider & Extension], debug: bool, renderer: Renderer, root_path: str, *, job_context: Context, localizer: Localizer) None[source]
async build() Path[source]

Build the Webpack assets.

Returns:

The path to the directory from which the assets can be copied to their final destination.

class betty.project.extension.webpack.build.EntryPointProvider[source]

Bases: Extension

An extension that provides Webpack entry points.

abstractmethod webpack_entry_point_cache_keys() Sequence[str][source]

Get the keys that make a Webpack build for this provider unique.

Providers that can be cached regardless may return ().

abstractmethod classmethod webpack_entry_point_directory_path() Path[source]

Get the path to the directory with the entry point assets.

The directory must include at least a package.json and main.ts.

betty.project.extension.webpack.build.webpack_build_id(entry_point_providers: Sequence[EntryPointProvider & Extension], debug: bool) str[source]

Generate the ID for a Webpack build.