Skip to content

Commit

Permalink
Fix handling updates to dynamic imports with HMR
Browse files Browse the repository at this point in the history
  • Loading branch information
zodern committed Oct 15, 2020
1 parent 7b535de commit 79529f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/dynamic-import/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Package.onUse(function (api) {
api.use("fetch");
api.use("modern-browsers");
api.use("inter-process-messaging", "server");
api.use("hot-module-replacement", { weak: true });

api.mainModule("client.js", "client");
api.mainModule("server.js", "server");
Expand Down
5 changes: 1 addition & 4 deletions tools/isobuild/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,7 @@ class Target {
data: resource.data,
hash: resource.hash,
cacheable: false,
// Temporarily override for the dynamic-import package
// to allow updating with HMR the modules that are
// dynamically imported
replaceable: resource.type === 'js' && (sourceBatch.hmrAvailable || name === 'dynamic-import')
replaceable: resource.type === 'js' && sourceBatch.hmrAvailable
});

const relPath = stripLeadingSlash(resource.servePath);
Expand Down

0 comments on commit 79529f5

Please sign in to comment.