/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/plugins/add-lazy-runtime-module-error/webpack.config.js
25 строк
564 B
Alexander Akait
perf: load webpack's own modules only when a build needs them (#21652)
10 авг 2026, 07:32
Не верифицирован
10 авг 2026, 07:32
8e28763
Код
Авторство
О чём код?
"use strict"; const PLUGIN_NAME = "AddLazyRuntimeModuleErrorTestPlugin"; /** @type {import("../../../../types").Configuration} */ module.exports = { plugins: [ { apply(compiler) { compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => { compilation.hooks.additionalTreeRuntimeRequirements.tap( PLUGIN_NAME, (chunk) => { compilation.addLazyRuntimeModule( chunk, () => Promise.reject(new Error("runtime module load failed")), (Ctor) => new Ctor() ); } ); }); } } ] };