mirror of https://github.com/curbengh/hexo-yam
fix: join Array, instead of using first index
This commit is contained in:
parent
461fe1dd41
commit
48bf9951f0
|
@ -121,8 +121,8 @@ function minifySvg () {
|
|||
assetPath.on('end', async () => {
|
||||
if (assetTxt.length) {
|
||||
try {
|
||||
const result = await new Svgo(options).optimize(assetTxt)
|
||||
if (options.logger) verbose.call(this, assetTxt.toString(), result.data, path, 'svg')
|
||||
const result = await new Svgo(options).optimize(assetTxt.join())
|
||||
if (options.logger) verbose.call(this, assetTxt.join().toString(), result.data, path, 'svg')
|
||||
resolve(route.set(path, result.data))
|
||||
} catch (err) {
|
||||
error.call(this, err)
|
||||
|
@ -155,7 +155,8 @@ function gzipFn () {
|
|||
assetPath.on('end', async () => {
|
||||
if (assetTxt.length) {
|
||||
try {
|
||||
const input = Buffer.from(assetTxt[0], 'utf-8')
|
||||
// TODO: Drop Buffer
|
||||
const input = Buffer.from(assetTxt.join(), 'utf-8')
|
||||
const result = await gzip(input, { level: zlib.constants.Z_BEST_COMPRESSION })
|
||||
if (options.logger) verbose.call(this, input, result.toString(), path, 'gzip')
|
||||
resolve(route.set(path + '.gz', result))
|
||||
|
@ -190,7 +191,7 @@ function brotliFn () {
|
|||
assetPath.on('end', async () => {
|
||||
if (assetTxt.length) {
|
||||
try {
|
||||
const input = Buffer.from(assetTxt[0], 'utf-8')
|
||||
const input = Buffer.from(assetTxt.join(), 'utf-8')
|
||||
const result = await br(input)
|
||||
if (options.logger) verbose.call(this, input, result.toString(), path, 'brotli')
|
||||
resolve(route.set(path + '.br', result))
|
||||
|
|
Loading…
Reference in New Issue