S
S
Sergey750il2020-01-10 21:55:09
Frontend
Sergey750il, 2020-01-10 21:55:09

Map disappears (sourcemaps) after refresh browser-sync?

Good day. After changing the SCSS, the page is refreshed without reloading, but after the refresh, the style map is not visible.
5e18c83d864bf246171678.jpeg
After update:
5e18c85218ebd656748587.jpeg
Attached is the code:

gulp.task('browser-sync', function() {
    browserSync.init({
        proxy: "portal.local",
        notify: false
    });
});

gulp.task('style:build', function() {
    gulp.src(path.src.style)
        //.pipe(sassGlob())
        .pipe(plumber({
            errorHandler: notify.onError("Error: <%= error.message %>")
        }))
        .pipe(sourcemaps.init())

        .pipe(sass({
            errLogToConsole: true
        }))
        .pipe(prefixer())
        //.pipe(cssmin())
        .pipe(sourcemaps.write())
        .pipe(gulp.dest(path.build.css))
        .pipe(browserSync.stream());
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Viktorovich, 2020-01-18
@shotlandec1980

Try the built in sourcemaps

gulp.task('style:build', function() {
    gulp.src(path.src.style, { sourcemaps: true })
        //.pipe(sassGlob())
        .pipe(plumber({
            errorHandler: notify.onError("Error: <%= error.message %>")
        }))
        .pipe(sass().on('error', sass.logError))
        .pipe(prefixer())
        //.pipe(cssmin())
        .pipe(gulp.dest(path.build.css, { sourcemaps: true }))
        .pipe(browserSync.stream());
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question