betty.project.extension.webpack.build module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.project.extension.webpack.build module

Perform Webpack builds.

class betty.project.extension.webpack.build.Builder

  Bases: `object`

  Build Webpack assets.

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

    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

  Bases: `Extension`

  An extension that provides Webpack entry points.

  abstract webpack_entry_point_cache_keys() → Sequence[str]

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

    Providers that can be cached regardless may `return ()`.

  abstract classmethod webpack_entry_point_directory_path() → Path

    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

  Generate the ID for a Webpack build.