fix: fixed css minify

This commit is contained in:
wherewhere 2024-12-14 15:47:25 +08:00
parent 0bf55ab474
commit c2ec422680
1 changed files with 1 additions and 2 deletions

View File

@ -13,11 +13,11 @@ async function minifyCss(str, data) {
const path = data.path
const { exclude, globOptions, verbose } = options
options.returnPromise = true
if (isMatch(path, exclude, globOptions)) return str
try {
console.log(path)
const styles = await new CleanCSS(options).minify(str).styles
if (verbose) logFn.call(this, str, styles, path, 'css')
return styles
@ -36,7 +36,6 @@ function minifyCssWithMap() {
/** @type {{ exclude: string[] }} */
const { exclude, globOptions, verbose } = options
const include = ['*.css', ...exclude.map(x => `!${x}`)]
options.returnPromise = true
const cleanCSS = new CleanCSS(options)
return Promise.all((match(routeList, include, globOptions)).map(path => {