drop gulp-cssnano, use gulp-postcss
This commit is contained in:
parent
b87d56c533
commit
cf4c4a0ece
5 changed files with 692 additions and 454 deletions
|
@ -165,7 +165,8 @@ function minifyTask(src, sourceMapBaseUrl) {
|
|||
const esbuild = require('esbuild');
|
||||
const sourceMappingURL = sourceMapBaseUrl ? ((f) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined;
|
||||
return cb => {
|
||||
const minifyCSS = require('gulp-cssnano');
|
||||
const cssnano = require('cssnano');
|
||||
const postcss = require('gulp-postcss');
|
||||
const sourcemaps = require('gulp-sourcemaps');
|
||||
const jsFilter = filter('**/*.js', { restore: true });
|
||||
const cssFilter = filter('**/*.css', { restore: true });
|
||||
|
@ -185,7 +186,7 @@ function minifyTask(src, sourceMapBaseUrl) {
|
|||
f.sourceMap = JSON.parse(sourceMapFile.text);
|
||||
cb(undefined, f);
|
||||
}, cb);
|
||||
}), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.mapSources((sourcePath) => {
|
||||
}), jsFilter.restore, cssFilter, postcss([cssnano({ preset: 'default' })]), cssFilter.restore, sourcemaps.mapSources((sourcePath) => {
|
||||
if (sourcePath === 'bootstrap-fork.js') {
|
||||
return 'bootstrap-fork.orig.js';
|
||||
}
|
||||
|
|
|
@ -236,7 +236,8 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
|||
const sourceMappingURL = sourceMapBaseUrl ? ((f: any) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined;
|
||||
|
||||
return cb => {
|
||||
const minifyCSS = require('gulp-cssnano') as typeof import('gulp-cssnano');
|
||||
const cssnano = require('cssnano') as typeof import('cssnano');
|
||||
const postcss = require('gulp-postcss') as typeof import('gulp-postcss');
|
||||
const sourcemaps = require('gulp-sourcemaps') as typeof import('gulp-sourcemaps');
|
||||
|
||||
const jsFilter = filter('**/*.js', { restore: true });
|
||||
|
@ -267,7 +268,7 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
|||
}),
|
||||
jsFilter.restore,
|
||||
cssFilter,
|
||||
minifyCSS({ reduceIdents: false }),
|
||||
postcss([cssnano({ preset: 'default' })]),
|
||||
cssFilter.restore,
|
||||
(<any>sourcemaps).mapSources((sourcePath: string) => {
|
||||
if (sourcePath === 'bootstrap-fork.js') {
|
||||
|
|
12
build/lib/typings/gulp-cssnano.d.ts
vendored
12
build/lib/typings/gulp-cssnano.d.ts
vendored
|
@ -1,12 +0,0 @@
|
|||
|
||||
declare module "gulp-cssnano" {
|
||||
function f(opts:{reduceIdents:boolean;}): NodeJS.ReadWriteStream;
|
||||
|
||||
/**
|
||||
* This is required as per:
|
||||
* https://github.com/microsoft/TypeScript/issues/5073
|
||||
*/
|
||||
namespace f {}
|
||||
|
||||
export = f;
|
||||
}
|
|
@ -98,8 +98,10 @@
|
|||
"@types/chokidar": "2.1.3",
|
||||
"@types/cookie": "^0.3.3",
|
||||
"@types/copy-webpack-plugin": "^6.0.3",
|
||||
"@types/cssnano": "^4.0.0",
|
||||
"@types/debug": "4.1.5",
|
||||
"@types/graceful-fs": "4.1.2",
|
||||
"@types/gulp-postcss": "^8.0.0",
|
||||
"@types/http-proxy-agent": "^2.0.1",
|
||||
"@types/keytar": "^4.4.0",
|
||||
"@types/minimist": "^1.2.1",
|
||||
|
@ -123,6 +125,7 @@
|
|||
"copy-webpack-plugin": "^6.0.3",
|
||||
"cson-parser": "^1.3.3",
|
||||
"css-loader": "^3.2.0",
|
||||
"cssnano": "^4.1.10",
|
||||
"debounce": "^1.0.0",
|
||||
"deemon": "^1.4.0",
|
||||
"electron": "11.2.0",
|
||||
|
@ -140,7 +143,6 @@
|
|||
"gulp-bom": "^3.0.0",
|
||||
"gulp-buffer": "0.0.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-cssnano": "^2.1.3",
|
||||
"gulp-eslint": "^5.0.0",
|
||||
"gulp-filter": "^5.1.0",
|
||||
"gulp-flatmap": "^1.0.2",
|
||||
|
@ -148,6 +150,7 @@
|
|||
"gulp-gzip": "^1.4.2",
|
||||
"gulp-json-editor": "^2.5.0",
|
||||
"gulp-plumber": "^1.2.0",
|
||||
"gulp-postcss": "^9.0.0",
|
||||
"gulp-remote-retry-src": "^0.6.0",
|
||||
"gulp-rename": "^1.2.0",
|
||||
"gulp-replace": "^0.5.4",
|
||||
|
|
Loading…
Reference in a new issue