N
N
Nicholas2018-04-20 13:19:00
open server
Nicholas, 2018-04-20 13:19:00

Why doesn't Gulp + OpenServer see the sourcemap?

Gulp project is located in the gulp.dev folder
Open Server is running (it worked with it previously, gulp.dev is in the domains folder as expected)
Proxying is configured for browserSync so that you can work with Open Server and use php

gulp.task('browserSync', function () {
  browserSync({
    proxy: 'gulp.dev',
    notify: false
  });
});

Attention! already used sourcemap, everything works without connection with Open Server. The folder path is set correctly.
Tell me what could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2018-11-20
@Nico_Maclay

Problem solved!
The map was not loaded due to an incorrect URL to the map, in the comments of the style file.
It was like this: /*# sourceMappingURL=styles.css.map */
And you need it like this: /*# sourceMappingURL=localhost3000/path/folder/styles.css.map */ You
need to make a pipe with URL adjustment.

.pipe(sourcemaps.write('./map', { // Выгружаем карту
         sourceMappingURL: function (file) {
            return ПутьБезФайлаКарты + file.relative + '.map'; // Правим коммент в стилях
         }
      }))

I hope the example is clear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question