builder/asset

Types

Represents a generic build asset with its file path and extension

pub type BuildAsset {
  BuildAsset(path: String, extension: String)
}

Constructors

  • BuildAsset(path: String, extension: String)

Represents a Gleam source file asset with its associated module information

pub type GleamAsset {
  GleamBuildAsset(module: module.Module, file: BuildAsset)
}

Constructors

Values

pub fn add_extension(
  asset: BuildAsset,
  extension: String,
) -> BuildAsset

Add an additional extension to a build asset’s path

Example: “file.gleam” + “.js” -> “file.gleam.js”

pub fn change_extension(
  asset: BuildAsset,
  extension: String,
) -> BuildAsset

Replace the extension of a build asset

Example: “file.gleam” changed to “.js” -> “file.js”

Search Document