BabelHelper
A set of utilities to easily modify a Babel configuration.
Static Method Summary
| Static Public Methods | ||
| public static |
addEnvPresetFeature(configuration: Object, feature: string | Array): Object Add a required feature to the |
|
| public static |
Adds a plugin or a list of them to a Babel configuration. |
|
| public static |
Adds a preset or a list of them to a Babel configuration. |
|
| public static |
disableEnvPresetModules(configuration: Object): Object Disable the |
|
| public static |
updateEnvPreset(configuration: Object, updateFn: UpdateEnvPresetFunction): Object Update the options of the |
|
Static Public Methods
public static addEnvPresetFeature(configuration: Object, feature: string | Array): Object source
Add a required feature to the env preset options (it will go on the include option).
public static addPlugin(configuration: Object, plugin: string | Array): Object source
Adds a plugin or a list of them to a Babel configuration. If the plugins option doesn't
exist, the method will create it.
public static addPreset(configuration: Object, preset: string | Array): Object source
Adds a preset or a list of them to a Babel configuration. If the presets option doesn't
exist, the method will create it.
public static disableEnvPresetModules(configuration: Object): Object source
Disable the env preset modules option as it may cause conflict with some packages.
Params:
| Name | Type | Attribute | Description |
| configuration | Object | The configuration to update. |
public static updateEnvPreset(configuration: Object, updateFn: UpdateEnvPresetFunction): Object source
Update the options of the env preset on a Babel configuration. If the presets option
doesn't exist, it will create one and add the preset. If presets exists and there's
already an env preset, it will update it. But if presets exists but there's no env
preset, it won't do anything.
Params:
| Name | Type | Attribute | Description |
| configuration | Object | The configuration to update. |
|
| updateFn | UpdateEnvPresetFunction | The function called in order to update the
|
