Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

datsteves/image-optimizer-webpack-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Optimizer Webpack loader

This Webpackloader is for my image-optimizer-core package. It reduces your JPEG's to a minimum (to even 80%-90% savings)

Install

please have a look at the instruction of node-opencv to install opencv on your machine.

# if you havent then please install
$ yarn add --dev file-loader

$ yarn add --dev image-optimizer-webpack-loader

Usage

// webpack.config.js
const path = require('path')

const config = {
  entry: path.resolve(__dirname, 'app.js'),
  output: {
    path: path.resolve(__dirname, 'build'),
    filename: 'bundle.js',
  },
  module: {
    rules: [{
      test: /\.jpe?g$/i,
      use: [
        'file-loader',
        'image-optimizer-webpack-loader',
      ],
    }],
  },
}

module.exports = config