Module

assets.pipeline

Optional Node-based asset pipeline integration for Bengal SSG.

Provides SCSS → CSS, PostCSS transforms, and JS/TS bundling via esbuild.

Behavior:

  • Only runs when enabled via config ([assets].pipeline = true).
  • Detects required CLIs on PATH and produces clear, actionable errors.
  • Compiles into a temporary pipeline output directory for subsequent Bengal fingerprinting and copying.

This module does not change the public API of asset processing; it returns compiled output files to be treated as regular assets by AssetOrchestrator.

Classes

PipelineConfig dataclass
0

Attributes

Name Type Description
root_path Path
theme_name str | None
enabled bool
scss bool
postcss bool
postcss_config str | None
bundle_js bool
esbuild_target str
sourcemaps bool
NodePipeline
Thin wrapper over Node CLIs (sass, postcss, esbuild).
2

Thin wrapper over Node CLIs (sass, postcss, esbuild).

Methods 1

build
Run the pipeline and return a list of compiled output files.
0 list[Path]
def build(self) -> list[Path]

Run the pipeline and return a list of compiled output files.

Returns

list[Path]

Internal Methods 1
__init__
1 None
def __init__(self, config: PipelineConfig) -> None
Parameters 1
config PipelineConfig

Functions

from_site
Factory to create pipeline from site config.
1 NodePipeline
def from_site(site: Site) -> NodePipeline

Factory to create pipeline from site config.

Parameters 1

Name Type Default Description
site Site

Returns

NodePipeline