S
S
Sergey Burduzha2020-10-14 12:51:03
gulp.js
Sergey Burduzha, 2020-10-14 12:51:03

Why doesn't sourcemap work?

Good afternoon.

I have two projects, one is local and the other is wordpress.

5f86ca8935bcd975291997.jpeg

Locally sourcemap works, but not on wordpress.

Project tree

5f86c9a53c4fe553021095.png

And the task itself

gulp.task("scss", function () {
  return gulp.src('assets/scss/my.scss')
    .pipe(plumber())
    .pipe(sourcemaps.init())
    .pipe(wait(500))
    .pipe(sass({
      outputStyle: 'expanded',
      allowEmpty: true
    }).on('error', notify.onError(function (error) {
      return 'An error occurred while compiling sass.\nLook in the console for details.\n' + error;
    })))
    .pipe(autoprefixer({
      cascade: false
    }))
    .pipe(gcmq())
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest('assets/css/'))
    .pipe(browserSync.reload({stream: true}));
});


Maybe the problem is that I work through a proxy?

gulp.task('browser-sync', function () {
  browserSync.init({
    proxy: {
      target: siteUrl,
      ws: true
    },
    reloadDelay: 1500
  });

  // browserSync.init({
  // 	server: {
  // 		baseDir: siteDir
  // 	},
  // 	notify: true
  // });
  gulp.watch("**/*.html").on('change', browserSync.reload);
  gulp.watch("**/*.php").on('change', browserSync.reload);
  gulp.watch("**/*.css").on('change', browserSync.reload);
  gulp.watch("**/*.js").on('change', browserSync.reload);
});


Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Burduzha, 2020-10-14
@serii81

Solved a problem.
It turns out that the chrome browser shows the cached version.
If you look incognito, then everything is fine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question