I was up updating the npm packages in my Bootstrap 4 WordPress theme, StrapPress, and broke my Gulp file. I really like using Gulp to autoprefix, minimize CSS/JS, refresh my browser on code changes, and many other handy tasks.
I kept getting an “Assertion Error: Task never defined” in my terminal:
It turns out I updated to Gulp 4 and needed to update my gulpfile.js tasks to use the latest Gulp markup. Didn’t take long to figured out that I needed to start using
gulp.parellel() to fix my terminal errors.
Below is my latest gulpfile.js for Gulp 4 and my WordPress development.
You can compare it to my old Gulp 3 file here: https://github.com/braginteractive/StrapPress/blob/7c28a362bf9986f210a0c6f4ba3d7c17c7608a34/gulpfile.js
I also took the opportunity to merge, delete, and clean up some of the tasks. Feel free to grab the code and use it in your projects.
If you have further optimizations for the file, comment below or on the Gist.