| 15 | * @returns {string} HMR runtime code |
| 16 | */ |
| 17 | const generateJavascriptHMR = (type) => |
| 18 | Template.getFunctionContent( |
| 19 | require("../hmr/JavascriptHotModuleReplacement.runtime") |
| 20 | ) |
| 21 | .replace(/\$key\$/g, type) |
| 22 | .replace(/\$installedChunks\$/g, "installedChunks") |
| 23 | .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") |
| 24 | .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) |
| 25 | .replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories) |
| 26 | .replace(/\$ensureChunkHandlers\$/g, RuntimeGlobals.ensureChunkHandlers) |
| 27 | .replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty) |
| 28 | .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) |
| 29 | .replace( |
| 30 | /\$hmrDownloadUpdateHandlers\$/g, |
| 31 | RuntimeGlobals.hmrDownloadUpdateHandlers |
| 32 | ) |
| 33 | .replace( |
| 34 | /\$hmrInvalidateModuleHandlers\$/g, |
| 35 | RuntimeGlobals.hmrInvalidateModuleHandlers |
| 36 | ); |
| 37 | |
| 38 | module.exports.generateJavascriptHMR = generateJavascriptHMR; |