/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/plugins/add-lazy-runtime-module/MarkerRuntimeModule.js
21 строка
570 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 RuntimeGlobals = require("../../../../lib/RuntimeGlobals"); const RuntimeModule = require("../../../../lib/RuntimeModule"); // Loaded through `addLazyRuntimeModule`, so it must reach the chunk's runtime. class MarkerRuntimeModule extends RuntimeModule { constructor() { super("lazy marker"); } /** * @returns {string} runtime code */ generate() { // the portable global: `globalThis` does not exist on the node baseline return `${RuntimeGlobals.global}.__lazyRuntimeMarker = "attached";`; } } module.exports = MarkerRuntimeModule;