Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

laravel-mix-imgmin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laravel-mix-imgmin

Laravel Mix extension to compress images [png,jpg,jpeg,svg,gif,bmp,ico] with TinyPNG.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

Laravel Mix imgmin

Laravel Mix extension to compress images [png,jpg,jpeg,svg,gif,bmp,ico] with TinyPNG.

Note

This extension uses Gulp 4. This can create unexpected behavior if you are using older version of Gulp inside your project.

Installation

Install the extension:

npm install laravel-mix-imgmin

Or if you prefer yarn:

yarn add laravel-mix-imgmin

Next require the extension inside your Laravel Mix config and call imgmin() in your pipeline:

// webpack.mix.js
const mix = require('laravel-mix');
require('laravel-mix-imgmin');

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .imgmin();

Options

Default options

If nothing is passed to the extension inside your Laravel Mix config, the following options will be used:

{
    input: 'resources/img',
    publicPath: 'public',
    output: 'img',
    tinyPngKey: null,
    debug: false
}

Option details

  • input (string). Your input directory where images are located.
  • publicPath (string). Your application's public path.
  • output (string). Your output directory where compressed images will be saved.
  • tinyPngKey (string or null). Your TinyPNG key. If you don't provide TinyPNG key, then default gulp-imagemin package will be used. TinyPNG is recommended for the best results.
  • debug (boolean). Whenever to log extension events messages to the console.

New in version 0.2.x

  • Now supports laravel-mix version 6

Keywords

laravel mix

FAQs

Package last updated on 15 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts