laravel-mix-image-size-checker
v0.1.4
Published
Checking image file size and width.
Downloads
5
Readme
Laravel Mix Image Size Checker
This extention provides a method to checking images size and width.
Usage
First, install the extension.
npm install laravel-mix-image-size-checker --save-dev
Then, add imageSizeChecker
function on webpack.mix.js
, and set srcPattern
option is required. like so:
let mix = require('laravel-mix')
require('laravel-mix-image-size-checker')
mix
.ImageSizeChecker({
maxSize: 300000,
maxWidth: 1600,
onErrorProcessExit: true,
srcPattern: 'resources/images/**/*'
})
And you're done!