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

Gulp task doesn't quit using ctrl-c #2830

Closed
paulmist opened this issue Jan 29, 2025 · 3 comments
Closed

Gulp task doesn't quit using ctrl-c #2830

paulmist opened this issue Jan 29, 2025 · 3 comments

Comments

@paulmist
Copy link

What were you expecting to happen?

After running a gulp task (gulp serve) and then pressing ctrl-c, I expected the task to end.

What actually happened?

The task keeps running in the background.

Please give us a sample of your gulpfile

"use strict";

const gulp       = require('gulp'),
	browsersync  = require('browser-sync').create(),
	sass         = require('gulp-sass'),
	notify       = require('gulp-notify'),
	cssnano		 = require('gulp-cssnano');

const supported = [
	"defaults"
];

// BrowserSync
function browserSync(done) {
	browsersync.init({		
		/*
		server: {
			baseDir: ".",
		},
		*/
		host: 'https://localhost:8443',
		proxy: 'https://localhost:8443',
		port: 3000,
		open: false

	});
	done();
}

// BrowserSync Reload
function browserSyncReload(done) {
  browsersync.reload();
  done();
}

//Watch
function watchFiles(){
	gulp.watch("borrow-style.scss", scss);
	gulp.watch("./scss/*.scss", scss);
	gulp.watch("./client/scss/*.scss", scss);
	gulp.watch("./js/*.js").on('change', browsersync.reload);
	gulp.watch("./*.php").on('change', browsersync.reload);
	gulp.watch("./anotherstyle.css").on('change', browsersync.reload);
	gulp.watch("./style.css").on('change', browsersync.reload);
	gulp.watch("./template-parts/*.php").on('change', browsersync.reload);
}

function scss(){
	return gulp
	.src("borrow-style.scss")
	.pipe(sass({
		outputStyle: 'compressed'
	}).on('error', sass.logError))
	.pipe(cssnano({
		zindex: false,
		autoprefixer: {browsers: supported, add: true}
	}))
	.pipe(gulp.dest("."))
	.pipe(notify("Compiled: <%= file.relative %>"))
	.pipe(browsersync.stream());
}

const serve = gulp.parallel(watchFiles, browserSync);

exports.serve = serve;

Terminal output / screenshots

If I run ps I can see:

 PID TTY           TIME CMD
  777 ttys000    0:00.73 -zsh
 3229 ttys000    0:03.31 gulp serve

Please provide the following information:

  • OS & version: MacOS Sonoma 14.4
  • node version (run node -v):v14.17.1
  • npm version (run npm -v):9.7.1
  • gulp version (run gulp -v):4.0.2
@phated phated closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2025
@phated
Copy link
Member

phated commented Feb 8, 2025

This issue tracker is not for help with external modules.

@paulmist
Copy link
Author

paulmist commented Feb 8, 2025

I'm sorry - I don't follow?

My issue is with Gulp tasks not stopping - not module.

Can you point me in the right direction instead of a total dead end?

@phated
Copy link
Member

phated commented Feb 8, 2025

I cannot because this is not a support forum.

@gulpjs gulpjs locked and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants