Home Reference Source
public class | source

WebpackBuildEngine

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

Constructor Summary

Public Constructor
public

constructor(environmentUtils: EnvironmentUtils, targets: Targets, webpackConfiguration: WebpackConfiguration, webpackPluginInfo: WebpackPluginInfo)

Class constructor.

Member Summary

Public Members
public

A local reference for the environmentUtils service.

public

A local reference for the targets service.

public

A local reference for the webpackConfiguration service.

public

A local reference for the plugin information.

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 webpack configuration for a target.

public

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

Public Constructors

public constructor(environmentUtils: EnvironmentUtils, targets: Targets, webpackConfiguration: WebpackConfiguration, webpackPluginInfo: WebpackPluginInfo) source

Class constructor.

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.

webpackConfiguration WebpackConfiguration

To generate a configuration for a target.

webpackPluginInfo WebpackPluginInfo

To get the path to the configuration file.

Public Members

public environmentUtils: EnvironmentUtils source

A local reference for the environmentUtils service.

public targets: Targets source

A local reference for the targets service.

public webpackConfiguration: WebpackConfiguration source

A local reference for the webpackConfiguration service.

public webpackPluginInfo: WebpackPluginInfo source

A local reference for the plugin information.

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 webpack 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 webpack configuration for a target.

Params:

NameTypeAttributeDescription
target Target

The target configuration.

buildType string

The intended build type: development or production.

Return:

object

public getWebpackConfig(): object source

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

Return:

object

Throw:

Error

If the environment variables are not present.