Merge pull request #201 from VesterDe/master - thx @VesterDe
Make Browsersync work correctly
This commit is contained in:
commit
fcc74448f6
|
@ -39,7 +39,6 @@ var clone = require('gulp-clone');
|
||||||
var merge = require('gulp-merge');
|
var merge = require('gulp-merge');
|
||||||
var sourcemaps = require('gulp-sourcemaps');
|
var sourcemaps = require('gulp-sourcemaps');
|
||||||
var browserSync = require('browser-sync').create();
|
var browserSync = require('browser-sync').create();
|
||||||
var reload = browserSync.reload;
|
|
||||||
|
|
||||||
|
|
||||||
// Run:
|
// Run:
|
||||||
|
@ -66,7 +65,7 @@ gulp.task('scss-for-prod', function() {
|
||||||
|
|
||||||
// Run:
|
// Run:
|
||||||
// gulp sourcemaps + sass + reload(browserSync)
|
// gulp sourcemaps + sass + reload(browserSync)
|
||||||
// Prepare the child-theme.css for the developpment environment
|
// Prepare the child-theme.css for the development environment
|
||||||
gulp.task('scss-for-dev', function() {
|
gulp.task('scss-for-dev', function() {
|
||||||
gulp.src('./sass/*.scss')
|
gulp.src('./sass/*.scss')
|
||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
|
@ -74,7 +73,6 @@ gulp.task('scss-for-dev', function() {
|
||||||
.pipe(sass())
|
.pipe(sass())
|
||||||
.pipe(sourcemaps.write(undefined, { sourceRoot: null }))
|
.pipe(sourcemaps.write(undefined, { sourceRoot: null }))
|
||||||
.pipe(gulp.dest('./css'))
|
.pipe(gulp.dest('./css'))
|
||||||
.pipe(reload({stream: true}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-scss', ['browser-sync'], function () {
|
gulp.task('watch-scss', ['browser-sync'], function () {
|
||||||
|
@ -104,7 +102,7 @@ gulp.task('watch', function () {
|
||||||
|
|
||||||
|
|
||||||
// Run:
|
// Run:
|
||||||
// gulp nanocss
|
// gulp cssnano
|
||||||
// Minifies CSS files
|
// Minifies CSS files
|
||||||
gulp.task('cssnano', ['cleancss'], function(){
|
gulp.task('cssnano', ['cleancss'], function(){
|
||||||
return gulp.src('./css/theme.css')
|
return gulp.src('./css/theme.css')
|
||||||
|
@ -114,7 +112,6 @@ gulp.task('cssnano', ['cleancss'], function(){
|
||||||
.pipe(cssnano({discardComments: {removeAll: true}}))
|
.pipe(cssnano({discardComments: {removeAll: true}}))
|
||||||
.pipe(sourcemaps.write('./'))
|
.pipe(sourcemaps.write('./'))
|
||||||
.pipe(gulp.dest('./css/'))
|
.pipe(gulp.dest('./css/'))
|
||||||
.pipe(reload({stream: true}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('cleancss', function() {
|
gulp.task('cleancss', function() {
|
||||||
|
|
Reference in New Issue