UNPKG

360 BJavaScriptView Raw
1if (module.hot) {
2 var hot = require('./index').hot
3 var cache = require.cache
4
5 // access parent
6 var parent = cache[module.parents[0]]
7 // remove itself from a cache
8 delete cache[module.id]
9 // setup hot for caller
10
11 exports.hot = hot(Object.assign({ id: parent.i }, parent))
12} else {
13 // prod mode
14 exports.hot = function(a) {
15 return a
16 }
17}