Skip to content

Commit

Permalink
Merge pull request #8511 from isiahmeadows/fix-erroneous-injection
Browse files Browse the repository at this point in the history
Remove a broken hook
  • Loading branch information
sokra committed Dec 19, 2018
2 parents f2f62c7 + 6b54a46 commit 573d2da
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/node/NodeSourcePlugin.js
Expand Up @@ -116,9 +116,6 @@ module.exports = class NodeSourcePlugin {
normalModuleFactory.hooks.parser
.for("javascript/dynamic")
.tap("NodeSourcePlugin", handler);
normalModuleFactory.hooks.parser
.for("javascript/esm")
.tap("NodeSourcePlugin", handler);
}
);
compiler.hooks.afterResolvers.tap("NodeSourcePlugin", compiler => {
Expand Down
12 changes: 12 additions & 0 deletions test/configCases/web/node-source/index.mjs
@@ -0,0 +1,12 @@
// Block `require`, but keep Webpack from trying to work around it.
eval("require = undefined")

it("should compile fine", () => {
// It's okay if this executes fine or if `global` is not defined. If it
// results in a `require()` call, this will throw a `TypeError` instead.
try {
global
} catch (e) {
if (!(e instanceof ReferenceError)) throw e
}
})
10 changes: 10 additions & 0 deletions test/configCases/web/node-source/webpack.config.js
@@ -0,0 +1,10 @@
module.exports = {
target: "web",
entry: "./index.mjs",
performance: {
hints: false
},
optimization: {
minimize: false
}
};

0 comments on commit 573d2da

Please sign in to comment.