Buckets:
| /* | |
| MIT License http://www.opensource.org/licenses/mit-license.php | |
| Author Tobias Koppers @sokra | |
| */ | |
| ; | |
| const NormalModule = require("./NormalModule"); | |
| /** @typedef {import("./Compiler")} Compiler */ | |
| const PLUGIN_NAME = "LoaderTargetPlugin"; | |
| class LoaderTargetPlugin { | |
| /** | |
| * @param {string} target the target | |
| */ | |
| constructor(target) { | |
| this.target = target; | |
| } | |
| /** | |
| * Apply the plugin | |
| * @param {Compiler} compiler the compiler instance | |
| * @returns {void} | |
| */ | |
| apply(compiler) { | |
| compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => { | |
| NormalModule.getCompilationHooks(compilation).loader.tap( | |
| PLUGIN_NAME, | |
| (loaderContext) => { | |
| loaderContext.target = this.target; | |
| } | |
| ); | |
| }); | |
| } | |
| } | |
| module.exports = LoaderTargetPlugin; | |
Xet Storage Details
- Size:
- 776 Bytes
- Xet hash:
- 6be9dd333a89d46924ce3d6c15efce9cb02d02759443618c96a22e665c721e5f
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.