Skip to main content

Interface: ImaCliPlugin

Defined in: types.ts:95

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?​

readonly optional cliArgs: Partial<Record<ImaCliCommand, CommandBuilder>>

Defined in: types.ts:104

Optional additional CLI arguments to extend the set of existing ones.


name​

readonly name: string

Defined in: types.ts:99

Plugin name, used mainly for better debugging messages.

Methods​

postProcess()?​

optional postProcess(args, imaConfig): Promise<void>

Defined in: types.ts:137

Optional plugin hook to do some custom processing after the compilation has finished. Attention! This hook runs only for build command.

Parameters​

args​

ImaCliArgs

imaConfig​

ImaConfig

Returns​

Promise<void>


prepareConfigurations()?​

optional prepareConfigurations(configurations, imaConfig, args): Promise<ImaConfigurationContext[]>

Defined in: types.ts:118

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​

configurations​

ImaConfigurationContext[]

imaConfig​

ImaConfig

args​

ImaCliArgs

Returns​

Promise<ImaConfigurationContext[]>


preProcess()?​

optional preProcess(args, imaConfig): Promise<void>

Defined in: types.ts:110

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​

args​

ImaCliArgs

imaConfig​

ImaConfig

Returns​

Promise<void>


webpack()?​

optional webpack(config, ctx, imaConfig): Promise<Configuration>

Defined in: types.ts:127

Webpack callback function used by plugins to customize/extend ima webpack config before it's run.

Parameters​

config​

Configuration

ctx​

ImaConfigurationContext

imaConfig​

ImaConfig

Returns​

Promise<Configuration>