mirror of https://github.com/curbengh/hexo-yam
fix: fixed css minify
This commit is contained in:
parent
0bf55ab474
commit
c2ec422680
|
@ -13,11 +13,11 @@ async function minifyCss(str, data) {
|
||||||
|
|
||||||
const path = data.path
|
const path = data.path
|
||||||
const { exclude, globOptions, verbose } = options
|
const { exclude, globOptions, verbose } = options
|
||||||
options.returnPromise = true
|
|
||||||
|
|
||||||
if (isMatch(path, exclude, globOptions)) return str
|
if (isMatch(path, exclude, globOptions)) return str
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
console.log(path)
|
||||||
const styles = await new CleanCSS(options).minify(str).styles
|
const styles = await new CleanCSS(options).minify(str).styles
|
||||||
if (verbose) logFn.call(this, str, styles, path, 'css')
|
if (verbose) logFn.call(this, str, styles, path, 'css')
|
||||||
return styles
|
return styles
|
||||||
|
@ -36,7 +36,6 @@ function minifyCssWithMap() {
|
||||||
/** @type {{ exclude: string[] }} */
|
/** @type {{ exclude: string[] }} */
|
||||||
const { exclude, globOptions, verbose } = options
|
const { exclude, globOptions, verbose } = options
|
||||||
const include = ['*.css', ...exclude.map(x => `!${x}`)]
|
const include = ['*.css', ...exclude.map(x => `!${x}`)]
|
||||||
options.returnPromise = true
|
|
||||||
const cleanCSS = new CleanCSS(options)
|
const cleanCSS = new CleanCSS(options)
|
||||||
|
|
||||||
return Promise.all((match(routeList, include, globOptions)).map(path => {
|
return Promise.all((match(routeList, include, globOptions)).map(path => {
|
||||||
|
|
Loading…
Reference in New Issue