Skip to content

Commit

Permalink
Fix compiler hang issue when using webpack-hot-middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckdumont committed Aug 15, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b4297aa commit a6d62d8
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -93,12 +93,17 @@ module.exports = class PreamblePlugin {
}

getResolver(compiler, callback) {
if (compiler.resolverFactory) {
if (this.resolver) {
callback(this.resolver);
}
else if (compiler.resolverFactory) {
// Webpack V4
tap(compiler.resolverFactory, "resolver normal", callback);
tap(compiler.resolverFactory, "resolver normal", resolver => {
callback(this.resolver = resolver);
});
} else {
// Webpack V3
callback(compiler.resolvers.normal);
callback(this.resolver = compiler.resolvers.normal);
}
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webpack-preamble-plugin",
"version": "1.0.2",
"version": "1.0.3",
"peerDependencies": {
"webpack": ">= 2.2.0"
},

0 comments on commit a6d62d8

Please sign in to comment.