refactor: remove object-assign ponyfill

Object.assign() is supported by node 4 and up
This commit is contained in:
weyusi 2018-10-27 18:38:12 +10:30
parent c3a10de6ee
commit 0946ab2f7b
2 changed files with 5 additions and 8 deletions

View File

@ -1,9 +1,7 @@
/* global hexo */ /* global hexo */
const assign = require('object-assign')
if (hexo.config.neat_enable === true) { if (hexo.config.neat_enable === true) {
// HTML minifier // HTML minifier
hexo.config.neat_html = assign({ hexo.config.neat_html = Object.assign({
enable: true, enable: true,
logger: false, logger: false,
exclude: [], exclude: [],
@ -18,14 +16,14 @@ if (hexo.config.neat_enable === true) {
}, hexo.config.neat_html) }, hexo.config.neat_html)
// Css minifier // Css minifier
hexo.config.neat_css = assign({ hexo.config.neat_css = Object.assign({
enable: true, enable: true,
logger: false, logger: false,
exclude: ['*.min.css'] exclude: ['*.min.css']
}, hexo.config.neat_css) }, hexo.config.neat_css)
// Js minifier // Js minifier
hexo.config.neat_js = assign({ hexo.config.neat_js = Object.assign({
enable: true, enable: true,
mangle: true, mangle: true,
logger: false, logger: false,
@ -35,13 +33,13 @@ if (hexo.config.neat_enable === true) {
}, hexo.config.neat_js) }, hexo.config.neat_js)
// html, css, js compression // html, css, js compression
hexo.config.neat_gzip = assign({ hexo.config.neat_gzip = Object.assign({
enable: true, enable: true,
logger: false logger: false
}, hexo.config.neat_gzip) }, hexo.config.neat_gzip)
// html, css, js compression // html, css, js compression
hexo.config.neat_brotli = assign({ hexo.config.neat_brotli = Object.assign({
enable: true, enable: true,
logger: false logger: false
}, hexo.config.neat_brotli) }, hexo.config.neat_brotli)

View File

@ -23,7 +23,6 @@
"html-minifier": "^3.5.20", "html-minifier": "^3.5.20",
"iltorb": "^2.4.0", "iltorb": "^2.4.0",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"object-assign": "^4.1.1",
"uglify-js": "^3.4.9" "uglify-js": "^3.4.9"
}, },
"keywords": [ "keywords": [