Skip to content

mattras82/optimizilla-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

optimizilla-webpack-plugin

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.

Installation

$ npm install -D optimizilla-webpack-plugin

Example Webpack Config

const optimizillaWebpackPlugin = require('optimizilla-webpack-plugin');

    //in your webpack plugins array
    module.exports = {
      plugins: [
          new optimizillaWebpackPlugin(
            ext: ['png', 'jpg', 'jpeg'],
            src: 'images'
          )
      ]
    }

Options

ext

Type: string[] | string

Default value: ['png', 'jpg', 'jpeg']

Array of file extensions to search for in the src directory.

src

Type: string

Default value: process.cwd()

The working directory path that the fast-glob searches in.

replace

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.

Contributors

License

http://www.opensource.org/licenses/mit-license.php

About

A webpack plugin to optimize & compress images through optimizilla (https://imagecompressor.com/)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published