Interface: ImaCliPlugin
@ima/cli.ImaCliPlugin
Interface for ima/cli plugins that can be defined in plugins field in ima.conf.js. These can be used to extend functionality of default CLI with custom cli arguments and webpack config overrides.
Properties
cliArgs
• Optional
Readonly
cliArgs: Partial
<Record
<ImaCliCommand
, CommandBuilder
>>
Optional additional CLI arguments to extend the set of existing ones.
Defined in
name
• Readonly
name: string
Plugin name, used mainly for better debugging messages.
Defined in
Methods
postProcess
▸ Optional
postProcess(args
, imaConfig
): Promise
<void
>
Optional plugin hook to do some custom processing after the compilation has finished. Attention! This hook runs only for build command.
Parameters
Name | Type |
---|---|
args | ImaCliArgs |
imaConfig | ImaConfig |
Returns
Promise
<void
>
Defined in
preProcess
▸ Optional
preProcess(args
, imaConfig
): Promise
<void
>
Optional plugin hook to do some pre processing right after the cli args are processed and the imaConfig is loaded, before the webpack config creation and compiler run.
Parameters
Name | Type |
---|---|
args | ImaCliArgs |
imaConfig | ImaConfig |
Returns
Promise
<void
>
Defined in
prepareConfigurations
▸ Optional
prepareConfigurations(configurations
, imaConfig
, args
): Promise
<ImaConfigurationContext
[]>
Called right before creating webpack configurations after preProcess call. This hook lets you customize configuration contexts for each webpack config that will be generated. This is usefull when you need to overrite configuration contexts for values that are not editable anywhere else (like output folders).
Parameters
Name | Type |
---|---|
configurations | ImaConfigurationContext [] |
imaConfig | ImaConfig |
args | ImaCliArgs |
Returns
Promise
<ImaConfigurationContext
[]>
Defined in
webpack
▸ Optional
webpack(config
, ctx
, imaConfig
): Promise
<Configuration
>
Webpack callback function used by plugins to customize/extend ima webpack config before it's run.
Parameters
Name | Type |
---|---|
config | Configuration |
ctx | ImaConfigurationContext |
imaConfig | ImaConfig |
Returns
Promise
<Configuration
>