From 3bd69a5b247749c4efd94c022e3de3bf61e92154 Mon Sep 17 00:00:00 2001 From: weyusi Date: Fri, 8 Mar 2019 21:07:51 +1030 Subject: [PATCH] feat: compress xml and json --- lib/filter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/filter.js b/lib/filter.js index 7b72517..acfd637 100644 --- a/lib/filter.js +++ b/lib/filter.js @@ -102,7 +102,7 @@ function logicGzip () { let route = hexo.route let routeList = route.list() - return Promise.all(routeList.filter(path => (path.endsWith('.html') || path.endsWith('.js') || path.endsWith('.css'))).map(path => { + return Promise.all(routeList.filter(path => (path.endsWith('.html') || path.endsWith('.js') || path.endsWith('.css') || path.endsWith('.xml') || path.endsWith('.json'))).map(path => { return new Promise((resolve, reject) => { // Grab all assets using hexo router let assetPath = route.get(path) @@ -142,7 +142,7 @@ function logicBrotli () { let route = hexo.route let routeList = route.list() - return Promise.all(routeList.filter(path => (path.endsWith('.html') || path.endsWith('.js') || path.endsWith('.css'))).map(path => { + return Promise.all(routeList.filter(path => (path.endsWith('.html') || path.endsWith('.js') || path.endsWith('.css') || path.endsWith('.xml') || path.endsWith('.json'))).map(path => { return new Promise((resolve, reject) => { // Grab all assets using hexo router let assetPath = route.get(path)