N
N
Nik_10112021-08-11 06:19:06
gulp.js
Nik_1011, 2021-08-11 06:19:06

How to minify libraries in Gulp 4?

Hello. Tell me please.

In gulp 4, I have libraries (libs.min.css, libs.min.js) and scripts (scripts.min.css, scripts.min.js) in separate files. But when minifying libraries, I need them to go one after another with comments, here is an example: And 611340da6e286693263306.png

now it turns out like this Here is my code
6113412d45559674276890.png


function libsCss() {
  return src(paths.styles.srcLibs)
    .pipe(eval(preprocessor)())
    .pipe(concat(paths.cssLibsOutputName))
    .pipe(autoprefixer({
      overrideBrowserslist: ['last 10 versions'],
      grid: true
    }))
    .pipe(cleancss({
      level: {
        1: {
          specialComments: 'all'
        }
      },
      /*format: 'beautify' */
    }))
    .pipe(dest(paths.styles.dest))
    .pipe(browserSync.stream())
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question