or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-2/

Micro-Frontend Role Config Helper

A helper that chooses the micro-frontend role for an Ice.js app and shapes bundle output so child apps expose a UMD library name.

Capabilities

Child role outputs UMD

  • With role: "child" and library: "marketingApp", the generated config uses the dependency's plugin in child mode and sets the bundle output to UMD named "marketingApp". @test

Custom library list

  • With role: "child" and library: ["legacyWidget", "modernWidget"], the generated config uses both library names for the UMD output so scripts can be consumed under either global. @test

Framework role passthrough

  • With role: "framework", the generated config uses the dependency's plugin in framework mode and leaves bundle output naming untouched. @test

Role validation

  • Providing any role other than "child" or "framework" throws an error explaining valid options. @test

Implementation

@generates

API

export type MicroFrontendRole = "child" | "framework";

export interface MicroFrontendOptions {
  role: MicroFrontendRole;
  library?: string | string[];
}

export interface MicroFrontendConfig {
  role: MicroFrontendRole;
  plugins: unknown[]; // contains the configured micro-frontend plugin instance
}

export function createMicroFrontendConfig(options: MicroFrontendOptions): MicroFrontendConfig;

Dependencies { .dependencies }

@ice/plugin-icestark { .dependency }

Micro-frontend plugin used to select framework vs child role and set library-based UMD output. @satisfied-by