From d501f5bc7118c5e50f6dba02d1b3c568a13b8100 Mon Sep 17 00:00:00 2001 From: liximomo Date: Mon, 9 Sep 2019 22:05:05 +0800 Subject: [PATCH 1/2] fix: fix hot-reload not working after options get modified --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index 35bc9fb..2a36f79 100644 --- a/src/index.js +++ b/src/index.js @@ -226,6 +226,8 @@ exports.reload = tryWrap((id, options) => { record.Ctor.extendOptions = options } const newCtor = record.Ctor.super.extend(options) + // prevent record.options._Ctor from being overwritten accidentally + newCtor.options._Ctor = record.options._Ctor; record.Ctor.options = newCtor.options record.Ctor.cid = newCtor.cid record.Ctor.prototype = newCtor.prototype From 2ee264732483a2509758583470a4fdd7cd177837 Mon Sep 17 00:00:00 2001 From: liximomo Date: Tue, 10 Sep 2019 17:37:01 +0800 Subject: [PATCH 2/2] style: remove semicolon --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 2a36f79..53560e2 100644 --- a/src/index.js +++ b/src/index.js @@ -227,7 +227,7 @@ exports.reload = tryWrap((id, options) => { } const newCtor = record.Ctor.super.extend(options) // prevent record.options._Ctor from being overwritten accidentally - newCtor.options._Ctor = record.options._Ctor; + newCtor.options._Ctor = record.options._Ctor record.Ctor.options = newCtor.options record.Ctor.cid = newCtor.cid record.Ctor.prototype = newCtor.prototype