/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v5.108.3
lib/LoaderTargetPlugin.js
41 строка
891 B
Alexander Akait
refactor: annotate constructor fields with @type to improve type coverage (#21265)
24 июн 2026, 13:36
Не верифицирован
24 июн 2026, 13:36
e8f9334
Код
Авторство
О чём код?
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const NormalModule = require("./NormalModule"); /** @typedef {import("./Compiler")} Compiler */ const PLUGIN_NAME = "LoaderTargetPlugin"; class LoaderTargetPlugin { /** * Creates an instance of LoaderTargetPlugin. * @param {string} target the target */ constructor(target) { /** @type {string} */ this.target = target; } /** * Applies the plugin by registering its hooks on the compiler. * @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;