Home Reference Source
public class | source

RollupConfiguration

This service reads the targets information and generates what would be the contents of a Rollup configuration file for them.

Constructor Summary

Public Constructor
public

constructor(buildVersion: BuildVersion, targets: Targets, targetsFileRules: TargetsFileRules, targetConfiguration: TargetConfigurationCreator, rollupConfigurations: RollupConfigurations)

Class constructor.

Member Summary

Public Members
public

A local reference for the buildVersion service.

public

A dictionary with the configurations for target type and build type.

public

A local reference for the targetConfiguration function service.

public

A local reference for the targets service.

public

A local reference for the targetsFileRules service.

Method Summary

Public Methods
public

getConfig(target: Target, buildType: string): Object

This method generates a complete Rollup configuration for a target.

Public Constructors

public constructor(buildVersion: BuildVersion, targets: Targets, targetsFileRules: TargetsFileRules, targetConfiguration: TargetConfigurationCreator, rollupConfigurations: RollupConfigurations) source

Class constructor.

Params:

NameTypeAttributeDescription
buildVersion BuildVersion

To load the project version.

targets Targets

To get the target information.

targetsFileRules TargetsFileRules

To get the file rules of the target.

targetConfiguration TargetConfigurationCreator

To create an overwrite configuration for the target.

rollupConfigurations RollupConfigurations

A dictionary of configurations for target type and build type.

Public Members

public buildVersion: BuildVersion source

A local reference for the buildVersion service.

public rollupConfigurations: RollupConfigurations source

A dictionary with the configurations for target type and build type.

public targetConfiguration: TargetConfigurationCreator source

A local reference for the targetConfiguration function service.

public targets: Targets source

A local reference for the targets service.

public targetsFileRules: TargetsFileRules source

A local reference for the targetsFileRules service.

Public Methods

public getConfig(target: Target, buildType: string): Object source

This method generates a complete Rollup configuration for a target. Before creating the configuration, it uses the reducer event rollup-configuration-parameters-for-browser or rollup-configuration-parameters-for-node, depending on the target type, and then rollup-configuration-parameters to reduce the parameters (RollupConfigurationParams) the services will use to generate the configuration. The event recevies the parameters and expects updated parameters in return.

Params:

NameTypeAttributeDescription
target Target

The target information.

buildType string

The intended build type: production or development.

Return:

Object

Throw:

Error

If there's no base configuration for the target type.

Error

If there's no base configuration for the target type and build type.

TODO:

  • Stop using `events` from `targets` and inject it directly on the class.