папка назначения в моем задании gulp для вывода критического css не работает - PullRequest
0 голосов
/ 10 апреля 2019

У меня есть следующая задача gulp и я запускаю ее в папку «Темы» для wordpress:

gulp.task('critical-css', function () {
  return gulp.src('./style.css')
    .pipe(criticalCss({
      out: 'critical.php', // output file name
      url: 'http://localhost/dimoco/', 
        // url from where we want penthouse to extract critical styles
      width: 1400, // max window width for critical media queries
      height: 900, // max window height for critical media queries
      userAgent: 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' 
        // pretend to be googlebot when grabbing critical page styles.
    }))
   .pipe(cssNano({
     safe:true // this isn't required, but I've included cssNano to minify the output file
   }))
  .pipe(gulp.dest('./template-parts/')); // destination folder for the output file
});

Когда я запускаю задачу, пишется файл с критическим css, называемым «themenamecritical.php».Но я подумал с кодом gulp: .pipe (gulp.dest ('./ template-parts /'));файл с именем crit.php будет записан в папке theme / template-parts /

Почему это не работает?

С уважением

...