A
A
AltaiR2018-10-18 17:23:55
css
AltaiR, 2018-10-18 17:23:55

How to properly configure gulp postcss-preset-env?

Hi all. I decided to switch from Sass to Postcss and immediately had such a problem. When saved, this:
5bc8967b1fd48960953301.png
turns into this:
5bc8963666e0e922092254.png
How can I remove these extra indents and add hyphens between blocks. Here is my gulpfile.js

gulp.task('css', function () {
  return gulp.src('css/style.css')
    .pipe(plumber())
    .pipe(sourcemaps.init())
    .pipe(postcss([
      postcssImport(),
      postcssPresetEnv({
        stage: 0
      })
    ]))
    .pipe(sourcemaps.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)
K
Konstantin Velichko, 2018-11-01
@AltaiR-05

Try to use any formatter.
For example postcss-perfectionist or gulp-prettier

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question