You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lesson 21 doesn't work, at least for me. I thought I'd open an issue, if only to reassure people who are having the same issue.
Unless there's another version, it seems gulp-imagemin has moved from CommonJS to modern ES Modules. This means the image optimisation can't be mixed with the non-module gulpfile.
If the course moves from Gulp to NPM Scripts this won't be an issue any more.
For now, and probably the next year or two, 11ty doesn't support ES Modules, cf. eleventy#836.
The quick fix is to pin an old version of gulp-imagemin, specifically "7.1.0". I suggest we change the install command to:
npm install gulp-imagemin@7.1.0 --save-exact
I've tested this and it fixes the problem. --save-exact is useful to avoid the site breaking if someone runs npm update.
I'll be bold and make a PR with this change. It fixes the problem, seems like the only solution for now, and even if we find something better later, the course will be unbroken in the meantime.
Reacted by Paul van den Dool, Josh Vickerson, Hanan Shoubaki and Patrick Johanneson
Activity
ComedyTomedy commentedon Feb 19, 2022
For now, and probably the next year or two, 11ty doesn't support ES Modules, cf. eleventy#836.
The quick fix is to pin an old version of gulp-imagemin, specifically "7.1.0". I suggest we change the install command to:
I've tested this and it fixes the problem.
--save-exactis useful to avoid the site breaking if someone runsnpm update.I'll be bold and make a PR with this change. It fixes the problem, seems like the only solution for now, and even if we find something better later, the course will be unbroken in the meantime.