Home Reference Source
public class | source

RollupBuildEngine

This build engine is in charge of generating the CLI commands and the configuration to bundle a target using Rollup.

Constructor Summary

Public Constructor
public

constructor(environmentUtils: EnvironmentUtils, targets: Targets, rollupConfiguration: RollupConfiguration, rollupPluginInfo: RollupPluginInfo)

Member Summary

Public Members
public

A local reference for the environmentUtils service.

public

A local reference for the rollupConfiguration service.

public

A local reference for the plugin information.

public

A local reference for the targets service.

Method Summary

Public Methods
public

getBuildCommand(target: Target, buildType: string, forceRun: boolean, forceWatch: boolean, forceInspect: boolean, forceAnalyze: boolean): string

Get the CLI build command to bundle a target.

public

getConfiguration(target: Target, buildType: string): object

Get a Rollup configuration for a target.

public

Get a Rollup configuration by reading the environment variables sent by the CLI command getBuildCommand generates.

Public Constructors

public constructor(environmentUtils: EnvironmentUtils, targets: Targets, rollupConfiguration: RollupConfiguration, rollupPluginInfo: RollupPluginInfo) source

Params:

NameTypeAttributeDescription
environmentUtils EnvironmentUtils

To load environment variables sent by the CLI command to the configuration builder method.

targets Targets

To get a target information.

rollupConfiguration RollupConfiguration

To generate a configuration for a target.

rollupPluginInfo RollupPluginInfo

To get the path to the configuration file.

Public Members

public environmentUtils: EnvironmentUtils source

A local reference for the environmentUtils service.

public rollupConfiguration: RollupConfiguration source

A local reference for the rollupConfiguration service.

public rollupPluginInfo: RollupPluginInfo source

A local reference for the plugin information.

public targets: Targets source

A local reference for the targets service.

Public Methods

public getBuildCommand(target: Target, buildType: string, forceRun: boolean, forceWatch: boolean, forceInspect: boolean, forceAnalyze: boolean): string source

Get the CLI build command to bundle a target.

Params:

NameTypeAttributeDescription
target Target

The target information.

buildType string

The intended build type: development or production.

forceRun boolean
  • optional
  • default: false

Force the target to run even if the runOnDevelopment setting is false.

forceWatch boolean
  • optional
  • default: false

Force Rollup to use the watch mode even if the watch setting for the required build type is set to false.

forceInspect boolean
  • optional
  • default: false

Enables the Node inspector even if the target setting is set to false.

forceAnalyze boolean
  • optional
  • default: false

Enables the bundle analyzer.

Return:

string

public getConfiguration(target: Target, buildType: string): object source

Get a Rollup configuration for a target.

Params:

NameTypeAttributeDescription
target Target

The target configuration.

buildType string

The intended build type: development or production.

Return:

object

public getRollupConfig(): object source

Get a Rollup configuration by reading the environment variables sent by the CLI command getBuildCommand generates.

Return:

object

Throw:

Error

If the environment variables are not present.