Comments (8)
The SVGO config format changed: a1579c0
from gulp-imagemin.
I also get this. Reverting to 7.1.0 solves it. Looks to me like an issue with the conversion to ESM.
from gulp-imagemin.
Same problem here
from gulp-imagemin.
You can solve this problem with renaming gulpfile.esm.js
back to gulpfile.js
and adding "type": "module"
to package.json
. However, there will be some restrictions:
- There must be a
gulpfile.js
file directly in the root directory. So you can't have anindex.js
file insidegulpfile.js
directory instead. - Any
import
of a JavaScript file (except modules installed withnpm
) must contain an extension.
For now this is the only solution I've found for 8.0.0
.
from gulp-imagemin.
My setup is as described (recently converted the package so it no longer uses esm). I get the error, but only on SVG files.
// Copy images
function images() {
return gulp.src(`${config.src}/img/**/*`)
.pipe(imagemin([
mozjpeg({
quality: 80,
}),
svgo({
plugins: [
{removeViewBox: false},
]
}),
imageminPngquant({
quality: [0.6, 0.8],
dithering: 1,
}),
]))
.pipe(gulp.dest(`${config.dist}/img`));
}
If I remove the SVG files from src/img the error doesn't happen.
from gulp-imagemin.
Thanks @sindresorhus, changing the config format fixed the issue for me.
from gulp-imagemin.
The SVGO config format changed: a1579c0
Please add this to the documentation as it would've save a lot more time.
from gulp-imagemin.
Hi there. Sorry for noticing so late. Currently, I don't have resources to try it out, so I'll close the issue and reopen it if anything goes wrong. Thanks!
from gulp-imagemin.
Related Issues (20)
- Conflict with Gulp Load Plugins HOT 4
- TypeError: Invalid host defined options HOT 3
- Is it expected to not work on Node.js 15? HOT 1
- "Plugin name should be specified" HOT 1
- Custom plugin settings: TypeError: imagemin.<plugin name> is not a function HOT 2
- Unable to import HOT 11
- Security issues HOT 1
- Keep original input file if optimized version is larger (or "already optimized") HOT 1
- 7.1.0: npm run build results with TypeError in plugin "gulp-imagemin" when running docker-compose on Apple Silicon device HOT 3
- Unable to install on Ubuntu 20.04.3 LTS HOT 2
- Does not appear to work with Gulp v4.0.2
- V8 require() of ES modules is not supported HOT 8
- TypeError in plugin "gulp-imagemin": function_ is not a function HOT 2
- Can't seem to run gulp-imagemin on my mac m1 HOT 2
- Error require() ^8.0.0
- gulp-imagemin plugin crashes with an error. HOT 3
- gulp-imagemin won't work on a computer without an internet connection HOT 1
- TypeError: imagemin.mozjpeg is not a function HOT 1
- crashed due to could not load default plugin `mozjpeg` and no images minfied HOT 3
- after updating gulp to version 5, jpg and png files compressed by the gulp-imagemin plugin are not readable HOT 11
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 gulp-imagemin.