/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v5.109.1
lib/cache/AddManagedPathsPlugin.js
44 строки
1 KB
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"; /** @typedef {import("../Compiler")} Compiler */ class AddManagedPathsPlugin { /** * Creates an instance of AddManagedPathsPlugin. * @param {Iterable<string | RegExp>} managedPaths list of managed paths * @param {Iterable<string | RegExp>} immutablePaths list of immutable paths * @param {Iterable<string | RegExp>} unmanagedPaths list of unmanaged paths */ constructor(managedPaths, immutablePaths, unmanagedPaths) { /** @type {Set<string | RegExp>} */ this.managedPaths = new Set(managedPaths); /** @type {Set<string | RegExp>} */ this.immutablePaths = new Set(immutablePaths); /** @type {Set<string | RegExp>} */ this.unmanagedPaths = new Set(unmanagedPaths); } /** * Applies the plugin by registering its hooks on the compiler. * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { for (const managedPath of this.managedPaths) { compiler.managedPaths.add(managedPath); } for (const immutablePath of this.immutablePaths) { compiler.immutablePaths.add(immutablePath); } for (const unmanagedPath of this.unmanagedPaths) { compiler.unmanagedPaths.add(unmanagedPath); } } } module.exports = AddManagedPathsPlugin;