A Webpack 4 plugin to optimize & compress images through optimizilla. This is simply a wrapper of the optimizilla-cli tool to be used with webpack.
$ npm install -D optimizilla-webpack-plugin
const optimizillaWebpackPlugin = require('optimizilla-webpack-plugin');
//in your webpack plugins array
module.exports = {
plugins: [
new optimizillaWebpackPlugin(
ext: ['png', 'jpg', 'jpeg'],
src: 'images'
)
]
}
Type: string[] | string
Default value: ['png', 'jpg', 'jpeg']
Array of file extensions to search for in the src
directory.
Type: string
Default value: process.cwd()
The working directory path that the fast-glob searches in.
Type: bool
Default value: true
Tells optimizilla-cli whether or not to replace the current files. When set to false
, the tool will append "-min" to each filename.