From 5ece7127c5e664a2dba71edbfe5037c22f82cc42 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Mon, 4 Dec 2017 17:59:37 +0800 Subject: [PATCH] fix: invalid all require.cache in watching --- lib/builder/builder.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 45c57269c0..d1ad08d6a0 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -460,8 +460,7 @@ export default class Builder { /* istanbul ignore if */ if (err) return reject(err) // not keep modified or deleted items in Vue.prototype - delete require.cache[require.resolve('vue')] - delete require.cache[require.resolve('vue-router')] + Object.keys(require.cache).forEach(key => delete require.cache[key]) }) ) return