/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/statsCases/child-compiler/TestApplyEntryOptionPlugin.js
36 строк
1 KB
Alexander Akait
fix: types
02 сен 2025, 17:12
Не верифицирован
02 сен 2025, 17:12
2d25a95
Код
Авторство
О чём код?
"use strict"; /** @typedef {import("../../../").Configuration} Configuration */ /** @typedef {import("../../../").Compiler} Compiler */ var EntryOptionPlugin = require("../../../").EntryOptionPlugin; var getNormalizedWebpackOptions = require("../../../").config.getNormalizedWebpackOptions; /** * Use the static method in EntryOptionPlugin to * apply entry option for the child compiler. */ module.exports = class TestApplyEntryOptionPlugin { /** * @param {Configuration} options options * @param {string} name name of a child compiler */ constructor(options, name = "TestApplyEntryOptionPlugin") { this.options = getNormalizedWebpackOptions(options); this.name = name; } /** * @param {Compiler} compiler compiler */ apply(compiler) { compiler.hooks.make.tapAsync( "TestApplyEntryOptionPlugin", (compilation, cb) => { const child = compilation.createChildCompiler(this.name); EntryOptionPlugin.applyEntryOption(child, compilation.compiler.context, this.options.entry); child.runAsChild(/** @type {EXPECTED_ANY} */ (cb)) } ) } }