You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
508 B

4 years ago
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const ExternalsPlugin = require("../ExternalsPlugin");
  7. const builtins =
  8. // eslint-disable-next-line node/no-unsupported-features/node-builtins,node/no-deprecated-api
  9. require("module").builtinModules || Object.keys(process.binding("natives"));
  10. class NodeTargetPlugin {
  11. apply(compiler) {
  12. new ExternalsPlugin("commonjs", builtins).apply(compiler);
  13. }
  14. }
  15. module.exports = NodeTargetPlugin;