Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated gulp file from Gulp 3.0 to Gulp 4.0; fixed breaking changes #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ethanny2
Copy link

@ethanny2 ethanny2 commented Nov 2, 2020

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)

//Gulp 3
gulp.watch("./public/sass/*/*.sass", ["sass", "minify-css"])
//Gulp 4
gulp.watch("./public/sass/*/*.sass", gulp.series("sass", "minify-css"));

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.

mangadbGulp4

…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 Rafase282 self-requested a review November 2, 2020 03:57
Copy link
Owner

@Rafase282 Rafase282 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants