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.

24 lines
480 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. class LoaderTargetPlugin {
  7. constructor(target) {
  8. this.target = target;
  9. }
  10. apply(compiler) {
  11. compiler.hooks.compilation.tap("LoaderTargetPlugin", compilation => {
  12. compilation.hooks.normalModuleLoader.tap(
  13. "LoaderTargetPlugin",
  14. loaderContext => {
  15. loaderContext.target = this.target;
  16. }
  17. );
  18. });
  19. }
  20. }
  21. module.exports = LoaderTargetPlugin;