H
H
HelpSophie2020-04-01 21:43:15
Media queries
HelpSophie, 2020-04-01 21:43:15

What is the correct plugin for @media grouping without sourcemap conflicts?

What is the correct plugin for grouping media without conflicts with gulp-sourcemaps?
So that he does not get confused in the order of the conditions.
Now gulp-group-css-media-queries.

piece of gulp

gulp.task("css", function () {
  return gulp.src("source/less/style.less")
    .pipe(plumber())
    .pipe(sourcemap.init())
    .pipe(less())
    .pipe(gcmq())
    .pipe(postcss([
      autoprefixer()
    ]))
    .pipe(gulp.dest("build/css"))
    .pipe(csso({
      restructure: false
    }))
    .pipe(rename("style.min.css"))
    .pipe(sourcemap.write("."))
    .pipe(gulp.dest("build/css"))
    .pipe(browserSync.stream());
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Morev, 2020-04-01
@SeaInside

Only through PostCSS, fortunately, you already have it connected.
One and two , your choice.
Personally, I use the first one, but not really comparing it - it just caught my eye earlier, but in general these are "extremes of the same flesh", very similar tools for solving the same problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question