Bom dia!
Já revi o código diversas vezes, tem um problema na tarefa "build-js", e depois de terminar, o cursor fica piscando e não consigo digitar mais nada no terminal, segue erro que aparece :
[10:53:02] Using gulpfile ~\Desktop\Alura\gulp-alura\projeto\gulpfile.js [10:53:02] Starting 'clean'... [10:53:02] Finished 'clean' after 35 ms [10:53:02] Starting 'copy'... [10:53:02] Finished 'copy' after 87 ms [10:53:02] Starting 'default'... [10:53:02] Starting 'build-img'... [10:53:02] Finished 'build-img' after 2.1 ms [10:53:02] Starting 'build-js'... [10:53:02] 'build-js' errored after 135 μs [10:53:02] TypeError: Cannot create property 'cwd' on string 'dist/js/home.js' at Object.createStream (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\glob-stream\index.js:19:46) at Object.create (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\glob-stream\index.js:68:42) at Gulp.src (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\vinyl-fs\lib\src\index.js:33:23) at Gulp. (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\gulpfile.js:38:7) at module.exports (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\orchestrator\lib\runTask.js:34:7) at Gulp.Orchestrator._runTask (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\orchestrator\index.js:273:3) at Gulp.Orchestrator._runStep (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\orchestrator\index.js:214:10) at C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\orchestrator\index.js:279:18 at finish (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\orchestrator\lib\runTask.js:21:8) at module.exports (C:\Users\munir.junior\Desktop\Alura\gulp-alura\projeto\node_modules\orchestrator\lib\runTask.js:60:3) [10:53:02] Finished 'default' after 4.84 ms
var gulp = require('gulp');
imagemin = require('gulp-imagemin');
clean = require('gulp-clean');
concat = require('gulp-concat')
htmlReplace = require('gulp-html-replace')
gulp.task('default', ['copy'], function(){
gulp.start('build-img', 'build-js', 'build-html');
})
gulp.task('copy', ['clean'], function(){
return gulp.src('src/**/*')
.pipe(gulp.dest('dist'));
});
gulp.task('clean',function(){
return gulp.src('dist')
.pipe(clean());
})
gulp.task('build-img', function() {
gulp.src('dist/img/**/*')
.pipe(imagemin())
.pipe(gulp.dest('dist/img'));
});
gulp.task('build-js', function() {
gulp.src('dist/js/jquery.js','dist/js/home.js', 'dist/js/produto.js')
.pipe(concat('all.js'))
.pipe(gulp.dest('dist/js'));
});
gulp.task('build-html',function() {
gulp.src('dist/**/*.html')
.pipe(htmlReplace({
js: 'js/all.js'
}))
.pipe(gulp.dest('dist'));
});
Alguém poderia me ajudar? Obrigado.