Migrated gulp file from Gulp 3.0 to Gulp 4.0; fixed breaking changes#55
Migrated gulp file from Gulp 3.0 to Gulp 4.0; fixed breaking changes#55ethanny2 wants to merge 2 commits intoRafase282:masterfrom
Conversation
…but left the gulp 3 method of declaring tasks via the gulp.task() function (still supported today).
…g the watch to not reload the page. Fixed by attaching an async event listener for the change event on all the gulp.watch() instances
Rafase282
left a comment
There was a problem hiding this comment.
I used your code and tested and found the following messages:
| => gulp sass
[12:56:07] Using gulpfile ~/Workspace/Rafase282/mangadb-front/gulpfile.js
[12:56:07] Starting 'sass'...
[12:56:07] The following tasks did not complete: sass
[12:56:07] Did you forget to signal async completion?
| => gulp minify-css
[12:56:51] Using gulpfile ~/Workspace/Rafase282/mangadb-front/gulpfile.js
[12:56:51] Starting 'minify-css'...
[12:56:51] Starting 'autoprefixer'...
Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.
Using browsers option can cause errors. Browserslist config
can be used for Babel, Autoprefixer, postcss-normalize and other tools.
If you really need to use option, rename it to overrideBrowserslist.
Learn more at:
https://github.com/browserslist/browserslist#readme
https://twitter.com/browserslist
[12:56:51] Finished 'autoprefixer' after 57 ms
[12:56:51] Finished 'minify-css' after 58 ms
| => gulp autoprefixer
[12:57:22] Using gulpfile ~/Workspace/Rafase282/mangadb-front/gulpfile.js
[12:57:22] Starting 'autoprefixer'...
Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.
Using browsers option can cause errors. Browserslist config
can be used for Babel, Autoprefixer, postcss-normalize and other tools.
If you really need to use option, rename it to overrideBrowserslist.
Learn more at:
https://github.com/browserslist/browserslist#readme
https://twitter.com/browserslist
[12:57:22] Finished 'autoprefixer' after 54 ms
| => gulp minify-js
[12:57:49] Using gulpfile ~/Workspace/Rafase282/mangadb-front/gulpfile.js
[12:57:49] Starting 'minify-js'...
[12:57:49] The following tasks did not complete: minify-js
[12:57:49] Did you forget to signal async completion?
Closes issue #54.
The only breaking changes from Gulp 3.0 -> Gulp 4.0 involves how tasks are specified in order.
Gulp 4 now uses gulp.series() to run tasks in order, or gulp.parallel() to run tasks in parallel. For the sake of convenience I left the Gulp 3 method of registering tasks as-is (using gulp.task() as opposed to exporting individual functions)
I did not test with the backend portion of the application but the default task (which depends on the other tasks to function) works and the browserSync sends out a reload message when any watched file is altered.