您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

LoaderTargetPlugin.js 480B

123456789101112131415161718192021222324
  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;