/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
lib/hmr/JavascriptHotModuleReplacementHelper.js
38 строк
1 KB
Aviv Keller
refactor: add basic descriptions (#20787)
10 апр 2026, 18:52
Не верифицирован
10 апр 2026, 18:52
16857f0
Код
Авторство
О чём код?
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Haijie Xie @hai-x */ "use strict"; const RuntimeGlobals = require("../RuntimeGlobals"); const Template = require("../Template"); /** * Generates javascript hmr. * @param {string} type unique identifier used for HMR runtime properties * @returns {string} HMR runtime code */ const generateJavascriptHMR = (type) => Template.getFunctionContent( require("../hmr/JavascriptHotModuleReplacement.runtime") ) .replace(/\$key\$/g, type) .replace(/\$installedChunks\$/g, "installedChunks") .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) .replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories) .replace(/\$ensureChunkHandlers\$/g, RuntimeGlobals.ensureChunkHandlers) .replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty) .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) .replace( /\$hmrDownloadUpdateHandlers\$/g, RuntimeGlobals.hmrDownloadUpdateHandlers ) .replace( /\$hmrInvalidateModuleHandlers\$/g, RuntimeGlobals.hmrInvalidateModuleHandlers ); module.exports.generateJavascriptHMR = generateJavascriptHMR;