Skip to content

Commit de9323f

Browse files
authored
Merge pull request webpack#3903 from willmendesneto/refactor-node-target-plugin
refactor(NodeTargetPlugin): upgrade to ES6
2 parents db45446 + ff8bf57 commit de9323f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎lib/node/NodeTargetPlugin.js‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
MIT License http://www.opensource.org/licenses/mit-license.php
33
Author Tobias Koppers @sokra
44
*/
5-
var ExternalsPlugin = require("../ExternalsPlugin");
5+
"use strict";
66

7-
function NodeTargetPlugin() {}
7+
const ExternalsPlugin = require("../ExternalsPlugin");
8+
9+
class NodeTargetPlugin {
10+
apply(compiler) {
11+
new ExternalsPlugin("commonjs", Object.keys(process.binding("natives"))).apply(compiler);
12+
}
13+
}
814

915
module.exports = NodeTargetPlugin;
10-
NodeTargetPlugin.prototype.apply = function(compiler) {
11-
new ExternalsPlugin("commonjs", Object.keys(process.binding("natives"))).apply(compiler);
12-
};

0 commit comments

Comments
 (0)