From cfd281fdc74e1282cc21d411b8847b9fe98dc636 Mon Sep 17 00:00:00 2001 From: MDLeom <43627182+curbengh@users.noreply.github.com> Date: Mon, 29 Jun 2020 00:41:47 +0100 Subject: [PATCH] fix(server-cache): must match exact alias there might a 3rd-party console registered that also starts with 's', e.g. 'save' --- lib/hexo/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/hexo/index.js b/lib/hexo/index.js index e6d92ec33b..3017c53746 100644 --- a/lib/hexo/index.js +++ b/lib/hexo/index.js @@ -317,8 +317,9 @@ class Hexo extends EventEmitter { const { cache } = Object.assign({ cache: false }, this.config.server); + const { alias } = this.extend.console; - if (this.env.cmd.startsWith('s') && cache) { + if (alias[this.env.cmd] === 'server' && cache) { // enable cache when run hexo server useCache = true; }