/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/inline-script-classic/__snapshots__/ConfigCacheTest.snap
177 строк
7 KB
Xiao
perf(runtime): skip IIFE wrapping for RuntimeModules without locals (#21633)
09 авг 2026, 17:30
Не верифицирован
09 авг 2026, 17:30
22b12df
Код
Авторство
О чём код?
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing exports[`ConfigCacheTestCases html inline-script-classic exported tests should emit IIFE-wrapped chunks for inline <script type=module> too (no output.module) 1`] = ` "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; /*!****************************************************************************************************************************************************************************!*\\\\ !*** data:text/javascript;base64,CmNvbnN0IGFyciA9IFsxLCAyLCAzXTsKY29uc3Qgc3VtID0gYXJyLnJlZHVjZSgoYSwgYikgPT4gYSArIGIsIDApOwp3aW5kb3cuX19pbmxpbmVNb2R1bGVTdW0gPSBzdW07Cg== ***! \\\\****************************************************************************************************************************************************************************/ const arr = [1, 2, 3]; const sum = arr.reduce((a, b) => a + b, 0); window.__inlineModuleSum = sum; /******/ })() ;" `; exports[`ConfigCacheTestCases html inline-script-classic exported tests should emit classic IIFE-wrapped chunks for inline <script> bodies 1`] = ` "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; /******/ var __webpack_modules__ = ({}); /************************************************************************/ /******/ // The module cache /******/ const __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ const cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ const module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ if (!(moduleId in __webpack_modules__)) { /******/ delete __webpack_module_cache__[moduleId]; /******/ const e = new Error(\\"Cannot find module '\\" + moduleId + \\"'\\"); /******/ e.code = 'MODULE_NOT_FOUND'; /******/ throw e; /******/ } /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ /************************************************************************/ /******/ /* webpack/runtime/chunk loaded */ /******/ (() => { /******/ const deferred = []; /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { /******/ if(chunkIds) { /******/ priority = priority || 0; /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; /******/ deferred[i] = [chunkIds, fn, priority]; /******/ return; /******/ } /******/ let notFulfilled = Infinity; /******/ for (var i = 0; i < deferred.length; i++) { /******/ let [chunkIds, fn, priority] = deferred[i]; /******/ let fulfilled = true; /******/ for (var j = 0; j < chunkIds.length; j++) { /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { /******/ chunkIds.splice(j--, 1); /******/ } else { /******/ fulfilled = false; /******/ if(priority < notFulfilled) notFulfilled = priority; /******/ } /******/ } /******/ if(fulfilled) { /******/ deferred.splice(i--, 1) /******/ const r = fn(); /******/ if (r !== undefined) result = r; /******/ } /******/ } /******/ return result; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { /******/ // no baseURI /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ const installedChunks = { /******/ \\"__html_cbe5b59d_0\\": 0 /******/ }; /******/ /******/ // no chunk on demand loading /******/ /******/ // no prefetching /******/ /******/ // no preloaded /******/ /******/ // no HMR /******/ /******/ // no HMR manifest /******/ /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ const webpackJsonpCallback = (parentChunkLoadingFunction, data) => { /******/ let [chunkIds, moreModules, runtime] = data; /******/ // add \\"moreModules\\" to the modules object, /******/ // then flag all \\"chunkIds\\" as loaded and fire callback /******/ var moduleId, chunkId, i = 0; /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { /******/ for(moduleId in moreModules) { /******/ if(__webpack_require__.o(moreModules, moduleId)) { /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; /******/ } /******/ } /******/ if(runtime) var result = runtime(__webpack_require__); /******/ } /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { /******/ installedChunks[chunkId][0](); /******/ } /******/ installedChunks[chunkId] = 0; /******/ } /******/ return __webpack_require__.O(result); /******/ } /******/ /******/ const chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ })(); /******/ /************************************************************************/ let __webpack_exports__ = {}; /*!********************************************************************************************************!*\\\\ !*** data:text/javascript;base64,CnZhciBncmVldGluZyA9ICJoaSI7CmNvbnNvbGUubG9nKCI8Yj5oZWxsbzwvYj4iKTsK ***! \\\\********************************************************************************************************/ var greeting = \\"hi\\"; console.log(\\"<b>hello</b>\\"); __webpack_exports__ = __webpack_require__.O(__webpack_exports__); /******/ })() ;" `; exports[`ConfigCacheTestCases html inline-script-classic exported tests should rewrite inline <script> tags and drop \`type=module\` when output.module is off 1`] = ` "<!DOCTYPE html> <html> <head> <title>Inline Script Classic Test</title> <script src=\\"__html_cbe5b59d_0.chunk.js\\"></script> <script src=\\"__html_cbe5b59d_1.chunk.js\\"></script> <script src=\\"__html_cbe5b59d_2.chunk.js\\" type=\\"text/javascript\\"></script> <!-- Non-JS type stays untouched --> <script type=\\"application/ld+json\\"> {\\"@context\\": \\"https://schema.org\\"} </script> </head> <body> <p>Hi</p> </body> </html> " `;