import {WebpackConfiguration} from 'projext-plugin-webpack/src/services/building/configuration.js'
WebpackConfiguration
This service reads the targets information and generates what would be the contents of a
webpack.config.js
for them.
Constructor Summary
Public Constructor | ||
public |
constructor(buildVersion: BuildVersion, pathUtils: PathUtils, targets: Targets, targetsFileRules: TargetsFileRules, targetConfiguration: TargetConfigurationCreator, webpackConfigurations: WebpackConfigurations) Class constructor. |
Member Summary
Public Members | ||
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A dictionary with the configurations for target type and build type. |
Method Summary
Public Methods | ||
public |
This method generates a complete webpack configuration for a target. |
Public Constructors
public constructor(buildVersion: BuildVersion, pathUtils: PathUtils, targets: Targets, targetsFileRules: TargetsFileRules, targetConfiguration: TargetConfigurationCreator, webpackConfigurations: WebpackConfigurations) source
Class constructor.
Params:
Name | Type | Attribute | Description |
buildVersion | BuildVersion | To load the project version. |
|
pathUtils | PathUtils | To generate the Webpack paths. |
|
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. |
|
webpackConfigurations | WebpackConfigurations | A dictionary of configurations for target type and build type. |
Public Members
public targetConfiguration: TargetConfigurationCreator source
A local reference for the targetConfiguration
function service.
public targetsFileRules: TargetsFileRules source
A local reference for the targetsFileRules
service.
public webpackConfigurations: WebpackConfigurations source
A dictionary with the configurations for target type and build type.
Public Methods
public getConfig(target: Target, buildType: string): Object source
This method generates a complete webpack configuration for a target.
Before creating the configuration, it uses the reducer event
webpack-configuration-parameters-for-browser
or webpack-configuration-parameters-for-node
,
depending on the target type, and then webpack-configuration-parameters
to reduce
the parameters (WebpackConfigurationParams) the services will use to generate the
configuration. The event recevies the parameters and expects updated parameters in return.
Throw:
If there's no base configuration for the target type. |
|
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.