Images Build Constants

Constants related to images when using file-loader (webpack).


Config Key: wsDir.img Return: string

The absolute path to the WS_ROOT + wsDir.img.
Same as pwd command.


Config key: deployDir.js
Return: string[]
Default: ['common', 'img']

Array of output directory names.


Config key: -
Return: string[]

An array of directory names obtained by adding DIST + OUTPUT_IMG_ARRAY.


Config key: options.webp
Return: IfWebpConverterConfig[](*)
Default: []

PNG, JPG, GIF files to Webp files convert.

* Return Types

interface IfWebpConverterConfig {
// Target directories name array for image files used converter
target: string[]
// Target extensions
ext: {
png: boolean
jpg: boolean
gif: boolean
// Output directories name array
output?: string[]
// PNG or JPEG options
options?: imageminWebp.Options
// GIF options
gifOptions?: {
lossy?: boolean
mixed?: boolean
quality?: number
method?: number
minimize?: boolean
kmin?: number
kmax?: number
filter?: number
metadata?: string
multiThreading?: boolean
buffer?: Buffer
// Delete the webp file before starting the task.
deleteBefore?: boolean

imageminWebp.Options is the see imagemin-webp options


Config key: options.imagemin
Return: [string, object][] | undefined
Default: undefined

Using imagemin plugins.