Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in outputName is not defined #85

Open
Korveld opened this issue Jul 26, 2022 · 0 comments
Open

ERROR in outputName is not defined #85

Korveld opened this issue Jul 26, 2022 · 0 comments

Comments

@Korveld
Copy link

Korveld commented Jul 26, 2022

Please help!

Can't convert images to webp, error messages appears
"ERROR in outputName is not defined"
"ERROR in ImageminWebpWebpackPlugin: "images/hero/hero.png" wasn't converted!"

here's my webpack.mix.js

`let mix = require('laravel-mix');

const ImageminPlugin = require('imagemin-webpack-plugin').default;
const CopyWebpackPlugin = require('copy-webpack-plugin');
const imageminMozjpeg = require('imagemin-mozjpeg');
const ImageminWebpWebpackPlugin = require("imagemin-webp-webpack-plugin");

mix.setPublicPath('public_html/');

// Images
mix.webpackConfig({
plugins: [
//Compress images
new CopyWebpackPlugin([{
from: '**/*', // FROM
to: 'images/', // TO
context: "resources/assets/images/",
}]),
new ImageminPlugin({
test: /.(jpe?g|png|gif|svg)$/i,
pngquant: {
quality: '70-80'
},
plugins: [
imageminMozjpeg({
quality: 85,
//Set the maximum memory to use in kbytes
maxmemory: 1000 * 512
})
]
}),
new ImageminWebpWebpackPlugin({
config: [{
test: /.(jpe?g|png)/,
options: {
quality: 75
}
}],
overrideExtension: true,
detailedLogs: true,
silent: false,
strict: true
})
],
});`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant