Skip to content

Upgrading gulp 4 to 5

Breaking4.0.2 → 5.0.1Breaking16Security1Platform2Deprecated1New8Changed4Fixed10Other2

BreakingUpgrade verdict

16 breaking changes and 2 platform requirement changes and a security fix.

  • Streams now assume UTF-8 text encoding by default instead of leaving encoding unset.
  • Glob patterns no longer preserve order; if you need files in a specific order, use the ordered-read-stream package.
  • gulp-cli no longer works with the old alpha versions of gulp 4.
  • The --verify command line flag is gone.
Top 5 of 20 that need code or config changes

Node.js requirement changed in 5.0.0: >= 0.10 → >=10.13.0.

Installs 143 packages in all (was 332).

Breaking16
Defaults stream encoding to UTF-8.
Removes support for ordered globs; use ordered-read-stream if ordering is needed.
ordered-read-stream
Removes support for alpha releases of v4 from gulp-cli.
gulp-cli
Removes the --verify flag.
--verify
Renames the --require flag to --preload to avoid conflicting with Node.js flags.
--require--preload
Removes many legacy and deprecated loaders.
Clones Vinyl objects with stream contents using teex but no longer waits for all streams to flow before clones receive data.
Vinylteex
Stops using process.umask() to make directories and falls back to Node's default mode.
process.umask()
Drops support of Node.js snake_case flags.
Standardizes on the anymatch library for globbing paths so globs behave the same in src and watch.
srcwatchanymatch
Normalizes all globs and paths to unix-like filepaths.
Only allows JS variants for .gulp.* config files.
.gulp.*
Throws on non-function, non-string option coercers.
Uses a Symbol for attaching the gulplog namespace to the store.
gulplog
Uses a Symbol for attaching the gulplog store to the global.
gulplog
Uses sha256 to hash the v8flags cache into a filename.
v8flags
Security1
Resolves some reported ReDoS CVEs and improves performance in glob-parent.
glob-parent
Platform2
Drops support for Node.js versions below 10.13.
Normalizes the repository and drops support for Node versions below 10.13.
Deprecated1
Upgrades gulplog to v2; messages logged via v1 also display a deprecated warning, and plugins should update to v2.
gulplog