M
M
mastaJoe2019-02-16 00:35:27
C++ / C#
mastaJoe, 2019-02-16 00:35:27

Where is the error in the GULP build?

node -v v11.9.0
gulp -v
[23:31:30] CLI version 2.0.1
[23:31:30] Local version 4.0.0

Does not work correctly, no changes in css when saving sass
const gulp = require('gulp');
const sass = require('gulp-sass');
const plumber = require('gulp-plumber');
const autoprefixer = require('gulp-autoprefixer');
const browserSync = require("browser-sync").create();

function style() {
    return (
        gulp.src("./src/sass/style.sass")
            .pipe(plumber())
            .pipe(sass()).on("error", sass.logError)
            .pipe(autoprefixer())
            .pipe(gulp.dest("./src/css/style.css"))
            .pipe(browserSync.stream())
    );
}

function reload() {
    browserSync.reload();
}
 
function watch() {
    browserSync.init({
        server: {
            baseDir: "./src"
        }
    });
    gulp.watch("src/sass/*.sass").on('change', browserSync.reload);
    gulp.watch("src/*.html").on('change', browserSync.reload);
}

exports.style = style;
exports.reload = reload;
exports.watch = watch;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RedHairOnMyHead, 2016-08-19
@PHASMO

The first argument in your function, as I understand it, implies the length of the word?
If so, then the sizeof of the string does not depend on its actual length.
In the inner loop, when you try to swap words, the j variable does not change.

A
Alexander, 2019-02-16
@mastaJoe

Addstyle

gulp.watch("src/sass/*.sass", style).on('change', browserSync.reload);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question