@Sayneone

Не работает сборка Gulp?

Начал работать с уже готовой сборкой и почему-то html, pug, и stylus работают, а вот js и пикчи не реагируют на изменения, помогите разобраться:
Вот это gulpfile (к нему еще идут отдельные файлы с каждым модулем, и отдельный файл с путями)
'use strict';

var gulp = require('gulp'),
	gulpLoadPlugins = require('gulp-load-plugins'),
	$ = gulpLoadPlugins(),
	gulpIf = require('gulp-if'),

	browserSync = require('browser-sync'),
	reload = browserSync.reload,
	plumber = require('gulp-plumber');


// PATHS 
var paths = require('./gulp/paths');
console.log($);

// TASKS
function newTask(taskName, path, options) {
	options = options || {};
	options.taskName = taskName; 
	gulp.task(taskName, function(callback) {
	var task = require(path).call(this, options);

	return task(callback);
	});
}


// BROWSER SYNC
gulp.task('server', ['styl', 'pug'], function() {
	browserSync.init({
		server: "./build",
		port: 4400
	});
});

gulp.task('watch-html', ['pug'], function () {
	browserSync.reload();
});

gulp.task('watch-js', ['js'], function () {
	browserSync.reload();
});


// HTML
newTask('html', './gulp/tasks/html', {
	src: paths.html.src ,
	dest: paths.html.dest
});


// PUG
newTask('pug', './gulp/tasks/pug', {
	src: 'src/pug/*.pug',
	dest: paths.html.dest
});

// STYLES
newTask('styl', './gulp/tasks/styl', {
	src: 'src/styl/main.styl',
	dest: paths.styl.dest
});

// IMAGES
newTask('gulp-imagemin', './gulp/tasks/compress', {
	src: paths.img.src,
	dest: paths.img.dest
});

// JS
newTask('js', './gulp/tasks/js', {
	src: paths.js.app,
	dest: paths.js.dest,
	minDest: paths.js.dest
});

newTask('js:min', './gulp/tasks/minjs', {
	src: paths.js.minSrc,
	dest: paths.js.minDest
});

gulp.task('jsMinSync', function () {
	return gulp.src('src/js/minifier/**/*.js')
		.pipe(plumber())
		.pipe(gulp.dest('build/js/'))
		.pipe(browserSync.stream());
});

// WATCH
gulp.task('watch', function () {
	// styl
	gulp.watch('src/styl/**/*.styl', ['styl']);
	// html
	gulp.watch(['src/html/**/*.html'], ['watch-html']);
	gulp.watch(['src/pug/**/*.pug'], ['watch-html']);
	// js
	gulp.watch("src/js/**/*.js", ['watch-js']);
});

gulp.task('default', ['js','server','watch','gulp-imagemin']);

gulp.task('build', ['copy','js','svg', 'html', 'styl', 'image:min', 'uploads:min', 'gulp-imagemin']);


Это файл с js
'use strict';

var gulp = require('gulp'),
	gulpLoadPlugins = require('gulp-load-plugins'),
	$ = gulpLoadPlugins(),
	//HTML
	include = require('gulp-file-include'),
	notify = require('gulp-notify'),
	debug = require('gulp-debug'),
	plumber = require('gulp-plumber'),
	multipipe = require('multipipe');

module.exports = function(options) {

	return function() {
		return multipipe (
			gulp.src(options.src),
			$.plumber({
				errorHandler: notify.onError(function(err){
					return{
						title: 'js:include',
						massage:err.massage
					};
				})
			}),
			include({
			  prefix: '@@',
			  basepath: '@file'
			}),
			$.debug({title:'js:include'}),
			gulp.dest(options.dest),
			$.uglify(),
			$.rename({
				extname: '.min.js'
			}),
			gulp.dest(options.minDest),
			notify("JS DONE!")
		);
	};

};


пикчи
'use strict';

var gulp = require('gulp'),
	gulpLoadPlugins = require('gulp-load-plugins'),
	$ = gulpLoadPlugins(),
	notify = require('gulp-notify'),
	imagemin = require('gulp-imagemin'),
	multipipe = require('multipipe');

module.exports = function(options) {

	return function() {
		return multipipe (
			gulp.src(options.src),
			$.imagemin()
			.pipe(gulp.dest(options.dest))
		);
	};
};


файл с путями прикладывать не буду, там все предельно понятно
  • Вопрос задан
  • 103 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
summer Ярославль
от 100 000 до 140 000 ₽
КРАФТТЕК Санкт-Петербург
от 60 000 до 80 000 ₽