Comments (7)
Please update https://github.com/webpack-contrib/image-minimizer-webpack-plugin/releases/tag/v4.0.2 and use configuration above, feel free to feedback
from image-minimizer-webpack-plugin.
@alexander-akait you can check my rep for investigation, I tried different options, but the error is always the same. Its clear project with only react, typescript and some loaders, without extra plugins.
https://github.com/redRusUnstpbl/sv_st1/
from image-minimizer-webpack-plugin.
Found a problem, bug in imageminSvgo
:
in imagemin-svgo
, they expected it should be buffer or string
if (!isSvg(buffer)) {
return buffer;
}
But in is-svg
:
if (typeof string !== 'string') {
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
}
So imagemin-svgo
accepts string | Buffer
, but is-svgo
only string
weird, WIP on this
from image-minimizer-webpack-plugin.
@alexander-akait It work now, thx )
from image-minimizer-webpack-plugin.
Hm, looks like something wrong with options, because imagemin doesn't validate them
from image-minimizer-webpack-plugin.
Investigate
from image-minimizer-webpack-plugin.
Okay, looks like imagemin-svgo
is not compatibility with imagemin@9
, but it is not a problem - let's use it directly, I will fix our docs, so after #444 merged (I want to do it today), please use this configuration:
new ImageMinimizerPlugin({
minimizer: [
{
implementation: ImageMinimizerPlugin.imageminMinify,
options: {
// Lossless optimization with custom option
// Feel free to experiment with options for better result for you
plugins: [
["gifsicle", { interlaced: true }],
["jpegtran", { progressive: true }],
["optipng", { optimizationLevel: 5 }],
],
},
},
{
implementation: ImageMinimizerPlugin.svgoMinify,
options: {
encodeOptions: {
// Pass over SVGs multiple times to ensure all optimizations are applied. False by default
multipass: true,
plugins: [
{
name: "preset-default",
params: {
overrides: {
removeViewBox: false,
addAttributesToSVGElement: {
params: {
attributes: [{ xmlns: "http://www.w3.org/2000/svg" }],
},
},
},
},
},
],
},
},
},
],
});
There is an issue with imagemin-svgo
- imagemin/imagemin-svgo#62, you faced with it, but I can't fix it here
from image-minimizer-webpack-plugin.
Related Issues (20)
- squooshGenerate error: " TypeError: Cannot read properties of undefined (reading 'get')" HOT 19
- Documentation: Typo in the squoosh-generator-resize section HOT 2
- How to use image-minimizer-webpack-plugin in an Angular application HOT 5
- Generate both PNGs and WEBPs HOT 4
- Incorrect filename temlate generation behavior HOT 10
- Typescript types are not correct
- types loader.d.ts throw error A constructor cannot have a 'this' parameter. HOT 3
- Typescript types are not correct HOT 1
- Request addition of support for `options.animated` HOT 1
- CSS paths for PNG to WebP incorrectly use backslash on Windows, resulting in invalid URLs HOT 4
- squooshMinify throws error and stops webpack execution: "ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time" HOT 5
- TypeError: Cannot read properties of undefined (reading 'setup') HOT 2
- Plugin should support using a generator for svg -> webp conversions (when using sharp) HOT 3
- Mark `squoosh` as deprecated HOT 3
- Licensing Concern with a Dependency Used by imagemin-pngquant HOT 4
- Support `@napi-rs/image`
- Processing the same image at different resizes results in both image being generated with the last size provided or paths mangled HOT 5
- Convert all jpg pngs to webp HOT 1
- Cannot read properties of undefined (reading 'setup')
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-minimizer-webpack-plugin.