From 54efcb8ad29153130394acb0e00998305a4737b9 Mon Sep 17 00:00:00 2001
From: ULIVZ <472590061@qq.com>
Date: Thu, 18 Oct 2018 03:23:26 +0800
Subject: [PATCH] fix: unexpected reload at dev when md contains frontmatter

---
 packages/@vuepress/markdown-loader/index.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/@vuepress/markdown-loader/index.js b/packages/@vuepress/markdown-loader/index.js
index 60c9992946..a72c7005e9 100644
--- a/packages/@vuepress/markdown-loader/index.js
+++ b/packages/@vuepress/markdown-loader/index.js
@@ -50,7 +50,7 @@ module.exports = function (src) {
     const cachedData = devCache.get(file)
     if (cachedData && (
       cachedData.inferredTitle !== inferredTitle ||
-      JSON.stringify(cachedData.frontmatter) !== JSON.stringify(frontmatter) ||
+      JSON.stringify(cachedData.frontmatterData) !== JSON.stringify(frontmatter.data) ||
       headersChanged(cachedData.headers, headers)
     )) {
       // frontmatter changed... need to do a full reload
@@ -59,7 +59,7 @@ module.exports = function (src) {
 
     devCache.set(file, {
       headers,
-      frontmatter,
+      frontmatterData: frontmatter.data,
       inferredTitle
     })
   }