-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.js
44 lines (39 loc) · 1.33 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* global hexo */
//module.exports = function (hexo) {
if (true === hexo.config.neat_enable) {
// HTML minifier
hexo.config.neat_html = Object.assign({
enable: true,
logger: true,
exclude: [],
ignoreCustomComments: [/^\s*more/],
removeComments: true,
removeCommentsFromCDATA: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeEmptyAttributes: true,
minifyJS: true,
minifyCSS: true,
}, hexo.config.neat_html);
// Css minifier
hexo.config.neat_css = Object.assign({
enable: true,
logger: true,
exclude: ['*.min.css']
}, hexo.config.neat_css);
// Js minifier
hexo.config.neat_js = Object.assign({
enable: true,
mangle: true,
logger: true,
output: {},
compress: {},
exclude: ['*.min.js'],
warnings: true
}, hexo.config.neat_js);
var filter = require('./lib/filter');
hexo.extend.filter.register('after_render:html', filter.logic_html);
hexo.extend.filter.register('after_render:css', filter.logic_css);
hexo.extend.filter.register('after_render:js', filter.logic_js);
}
//}