JSPM

@chiiya/laravel-mix-imagemin

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q50324F
  • License MIT

Imagemin plugin for Laravel Mix

Package Exports

  • @chiiya/laravel-mix-imagemin
  • @chiiya/laravel-mix-imagemin/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chiiya/laravel-mix-imagemin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme


Laravel Mix Imagemin

Laravel Mix plugin for optimizing images using imagemin.

installation   ·   usage   ·   options


Installation

npm i --dev @chiiya/laravel-mix-imagemin

Usage

Require it in your webpack.mix.js file, then pass it a valid copy-webpack-plugin config:

require('@chiiya/laravel-mix-imagemin');

mix
  .imagemin({
    patterns: [
      {
        from: '**/*',
        to: 'images',
        context: 'resources/images',
      },
    ],
  });

Options

The mix.imagemin function accepts to parameters: options for the copy-webpack-plugin and options for the imagemin-webpack-plugin.

require('@chiiya/laravel-mix-imagemin');

mix
  .imagemin({
    patterns: [
      {
        from: '**/*',
        to: 'images',
        context: 'resources/images',
      },
    ],
  }, {
    pngquant: {
      quality: '95-100'
    }
  });

Attributions

Forked from CupOfTea696/laravel-mix-imagemin.