LoaderTargetPlugin.js 415B

1234567891011121314151617181920
  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.plugin("compilation", (compilation) => {
  12. compilation.plugin("normal-module-loader", (loaderContext) => loaderContext.target = this.target);
  13. });
  14. }
  15. }
  16. module.exports = LoaderTargetPlugin;