Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
build: replace deprecated gulp-cssnano with gulp-postcss
Browse files Browse the repository at this point in the history
- fixes NPM audit warnings
- replace gulp-autoprefixer with gulp-postcss and using autoprefixer directly
  • Loading branch information
Splaktar committed Jul 17, 2020
1 parent 55ae966 commit e8e8ac8
Show file tree
Hide file tree
Showing 4 changed files with 1,280 additions and 2,150 deletions.
15 changes: 10 additions & 5 deletions gulp/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const plumber = require('gulp-plumber');
const ngAnnotate = require('gulp-ng-annotate');
const insert = require('gulp-insert');
const gulpif = require('gulp-if');
const nano = require('gulp-cssnano');
const cssnano = require('cssnano');
const gulpPostcss = require('gulp-postcss');
const postcss = require('postcss');
const _ = require('lodash');
const constants = require('./const');
Expand Down Expand Up @@ -77,13 +78,17 @@ function buildJs() {

function minifyCss(extraOptions) {
const options = {
autoprefixer: false,
reduceTransforms: false,
svgo: false,
safe: true
svgo: false
};
const preset = {
preset: [
'default',
_.assign(options, extraOptions)
]
};

return nano(_.assign(options, extraOptions));
return gulpPostcss([cssnano(preset)]);
}

/**
Expand Down

0 comments on commit e8e8ac8

Please sign in to comment.