D:\FranciscoFlorentino\CURSOS\AluraCursos\GULP\projeto\src>gulp server [14:34:18] Working directory changed to D:\FranciscoFlorentino\CURSOS\AluraCursos\GULP\projeto [SyntaxError: D:\FranciscoFlorentino\CURSOS\AluraCursos\GULP\projeto\node_modules\browser-sync\node_modules\browser-sync-client\index.js:54 .reduce((stringOutput, item) => { ^^ Unexpected token =>]
D:\FranciscoFlorentino\CURSOS\AluraCursos\GULP\projeto\src>cd..
D:\FranciscoFlorentino\CURSOS\AluraCursos\GULP\projeto>gulp server [SyntaxError: D:\FranciscoFlorentino\CURSOS\AluraCursos\GULP\projeto\node_modules\browser-sync\node_modules\browser-sync-client\index.js:54 .reduce((stringOutput, item) => { ^^ Unexpected token =>]
D:\FranciscoFlorentino\CURSOS\AluraCursos\GULP\projeto>
package.json { "name": "projeto", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1", "gulp": "gulp" }, "author": "", "license": "ISC", "devDependencies": { "browser-sync": "^2.9.8", "gulp": "^3.9.0", "gulp-clean": "^0.3.1", "gulp-concat": "^2.6.0", "gulp-cssmin": "^0.1.7", "gulp-html-replace": "^1.5.4", "gulp-imagemin": "^2.3.0", "gulp-uglify": "^1.4.1", "gulp-usemin": "^0.3.14" } }
gupfile.js var gulp = require('gulp'), imagemin = require('gulp-imagemin'), clean = require('gulp-clean'), concat = require('gulp-concat'), htmlReplace = require('gulp-html-replace'), uglify = require('gulp-uglify'), usemin = require('gulp-usemin'), cssmin = require('gulp-cssmin'), browserSync = require('browser-sync');
gulp.task('default',['copy'],function(){ //gulp.start('build-img', 'build-js', 'build-html'); gulp.start('build-img', 'usemin'); } );
gulp.task('copy',['clean'], function(){ //vai esperar a finalização da TASK clean para executar a copy return gulp.src('src/*/') .pipe(gulp.dest('dist')); });
gulp.task('clean', function(){ //retorna o stream da tarefa executada e informa para quem está chamando internamente esperar a sua execução return gulp.src('dist') .pipe(clean()); });
gulp.task('build-img', function(){ gulp.src('dist/img/*/') .pipe(imagemin()) .pipe(gulp.dest('dist/img')); });
gulp.task('usemin', function(){ gulp.src('dist/*/.html') .pipe(usemin({ 'js': [uglify], 'css': [cssmin] })) .pipe(gulp.dest('dist')); });
gulp.task('server', function(){ browserSync.init({ server: { baseDir:'src' //proxy: "localhost:3000" } });
gulp.watch('src/**/*').on('change', browserSync.reload);
});