Skip to content

Commit

Permalink
fix: es module interop in HMR code
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea committed Mar 3, 2021
1 parent 8b584bd commit 8bc2fe3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module.exports.pitch = function (remainingRequest) {
' if(!content.locals) {',
' module.hot.accept(' + request + ', function() {',
' var newContent = require(' + request + ');',
' if(newContent.__esModule) newContent = newContent.default;',
" if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];",
' update(newContent);',
' });',
Expand Down

0 comments on commit 8bc2fe3

Please sign in to comment.