2014-04-09 15:12:04 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
2017-01-19 11:28:55 +08:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
class LoaderTargetPlugin {
|
|
|
|
constructor(target) {
|
|
|
|
this.target = target;
|
|
|
|
}
|
|
|
|
|
|
|
|
apply(compiler) {
|
|
|
|
compiler.plugin("compilation", (compilation) => {
|
2017-02-05 07:30:01 +08:00
|
|
|
compilation.plugin("normal-module-loader", (loaderContext) => loaderContext.target = this.target);
|
2017-01-19 11:28:55 +08:00
|
|
|
});
|
|
|
|
}
|
2014-04-09 15:12:04 +08:00
|
|
|
}
|
2017-01-19 11:28:55 +08:00
|
|
|
|
2014-04-09 15:12:04 +08:00
|
|
|
module.exports = LoaderTargetPlugin;
|