GithubHelp home page GithubHelp logo

Comments (8)

sindresorhus avatar sindresorhus commented on May 27, 2024 1

The SVGO config format changed: a1579c0

from gulp-imagemin.

chriswthomson avatar chriswthomson commented on May 27, 2024

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.

jmartsch avatar jmartsch commented on May 27, 2024

Same problem here

from gulp-imagemin.

 avatar commented on May 27, 2024

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:

  1. There must be a gulpfile.js file directly in the root directory. So you can't have an index.js file inside gulpfile.js directory instead.
  2. Any import of a JavaScript file (except modules installed with npm) must contain an extension.

For now this is the only solution I've found for 8.0.0.

from gulp-imagemin.

chriswthomson avatar chriswthomson commented on May 27, 2024

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.

chriswthomson avatar chriswthomson commented on May 27, 2024

Thanks @sindresorhus, changing the config format fixed the issue for me.

from gulp-imagemin.

DaveyJake avatar DaveyJake commented on May 27, 2024

The SVGO config format changed: a1579c0

Please add this to the documentation as it would've save a lot more time.

from gulp-imagemin.

 avatar commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.