mirror of https://github.com/curbengh/hexo-yam
refactor: destructure object
This commit is contained in:
parent
85bfd3ba35
commit
de425e4b6f
|
@ -65,9 +65,9 @@ async function minifyCss (str, data) {
|
|||
if (isMatch(path, exclude, globOptions)) return str
|
||||
|
||||
try {
|
||||
const result = await new CleanCSS(options).minify(str)
|
||||
if (options.logger) verbose.call(this, str, result.styles, path, 'css')
|
||||
return result.styles
|
||||
const { styles } = await new CleanCSS(options).minify(str)
|
||||
if (options.logger) verbose.call(this, str, styles, path, 'css')
|
||||
return styles
|
||||
} catch (err) {
|
||||
error.call(this, err)
|
||||
}
|
||||
|
@ -94,10 +94,10 @@ function minifyJs (str, data) {
|
|||
delete jsOptions.logger
|
||||
delete jsOptions.globOptions
|
||||
|
||||
const result = Terser.minify(str, jsOptions)
|
||||
if (options.logger) verbose.call(this, str, result.code, path, 'js')
|
||||
const { code } = Terser.minify(str, jsOptions)
|
||||
if (options.logger) verbose.call(this, str, code, path, 'js')
|
||||
|
||||
return result.code
|
||||
return code
|
||||
}
|
||||
|
||||
function minifySvg () {
|
||||
|
|
Loading…
Reference in New Issue