react-router-ga
Version:
[](https://npm.im/react-router-ga) [](https://npm.im/react-router-ga) [](https://ope
25 lines (21 loc) • 480 B
JavaScript
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
;
class LoaderTargetPlugin {
constructor(target) {
this.target = target;
}
apply(compiler) {
compiler.hooks.compilation.tap("LoaderTargetPlugin", compilation => {
compilation.hooks.normalModuleLoader.tap(
"LoaderTargetPlugin",
loaderContext => {
loaderContext.target = this.target;
}
);
});
}
}
module.exports = LoaderTargetPlugin;