Просмотр исходного кода

Revert "refactor(dev): use cssnano as postcss plugin"

This reverts commit 6868716d56a173f932c933f6cb45752323779ef1.
Andelf 3 лет назад
Родитель
Сommit
44ddd10103
2 измененных файлов с 10 добавлено и 5 удалено
  1. 10 4
      gulpfile.js
  2. 0 1
      postcss.config.js

+ 10 - 4
gulpfile.js

@@ -23,10 +23,16 @@ const css = {
   },
 
   buildCSS (...params) {
-    return cp.spawn(`yarn css:build`, {
-      shell: true,
-      stdio: 'inherit'
-    })
+    return gulp.series(
+      () => exec(`yarn css:build`, {}),
+      css._optimizeCSSForRelease
+    )(...params)
+  },
+
+  _optimizeCSSForRelease () {
+    return gulp.src(path.join(outputPath, 'css', 'style.css'))
+      .pipe(cleanCSS())
+      .pipe(gulp.dest(path.join(outputPath, 'css')))
   }
 }
 

+ 0 - 1
postcss.config.js

@@ -4,6 +4,5 @@ module.exports = (ctx) => ({
     require('postcss-import-ext-glob')({}),
     require('postcss-import')({}),
     require('tailwindcss')('tailwind.config.js'),
-    ...(process.env.NODE_ENV === 'production' ? [require('cssnano')({})] : [])
   ],
 })