Skip to content

Commit

Permalink
Merge pull request #4 from chuckdumont/work
Browse files Browse the repository at this point in the history
Fix compiler hang issue when using webpack-hot-middleware
  • Loading branch information
chuckdumont authored Aug 15, 2018
2 parents 8985b65 + a6d62d8 commit 0f8d29c
Show file tree
Hide file tree
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
Expand Up @@ -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"
},
Expand Down

0 comments on commit 0f8d29c

Please sign in to comment.