i started using gulp projects have little problem.
browerssync works fine on watch, sass not compile on watch (manualy works fine). here gulpfile.js - problem?
var gulp = require('gulp'); var sass = require('gulp-sass'); var imagemin = require('gulp-imagemin'); var browsersync = require('browser-sync').create(); var cache = require('gulp-cache'); gulp.task('sass', function(){ return gulp.src('./dev/sass/*.scss') .pipe(sass()) // using gulp-sass .pipe(gulp.dest('./assets/css')) .pipe(browsersync.reload({ stream: true })) }); gulp.task('images', function(){ return gulp.src('./dev/images/**/*.+(png|jpg|jpeg|gif|svg)') // caching images ran through imagemin .pipe(cache(imagemin({ interlaced: true }))) .pipe(gulp.dest('./assets/images')) }); gulp.task('browsersync', function() { browsersync.init({ server: { basedir: '' }, }) }); gulp.task( 'watch', ['browsersync', 'sass'], function () { gulp.watch( './dev/sass/*.scss', ['sass'] ); gulp.watch( '*.html', browsersync.reload ); });
edit: here log console:
d:\esports-ground\portal>gulp watch (node:9416) fs: re-evaluating native module sources not supported. if using graceful- fs module, please update more recent version. [21:49:16] using gulpfile d:\esports-ground\portal\gulpfile.js [21:49:16] starting 'browsersync'... [21:49:16] finished 'browsersync' after 13 ms [21:49:16] starting 'sass'... [bs] 1 file changed (style.css) [21:49:16] finished 'sass' after 39 ms [21:49:16] starting 'watch'... [21:49:16] finished 'watch' after 12 ms [bs] access urls: ------------------------------------- local: http://localhost:3000 external: http://192.168.56.1:3000 ------------------------------------- ui: http://localhost:3001 ui external: http://192.168.56.1:3001 ------------------------------------- [bs] serving files from: ./
Comments
Post a Comment