/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/module/iife-multiple-entry-modules/test.js
13 строк
587 B
Alexander Akait
perf(JavascriptModulesPlugin): drop the entry IIFE for multiple inlined entries by renaming collisions (#21151)
10 июн 2026, 00:59
Не верифицирован
10 июн 2026, 00:59
0afe292
Код
Авторство
О чём код?
const fs = require("fs"); const path = require("path"); const read = (file) => fs.readFileSync(path.join(__dirname, file), "utf-8"); const MARKER = "isolated against other entry modules"; it("resolves the colliding declaration by renaming instead of an IIFE", () => { // `value` collides (index1 reads it as a global, index2 declares it); with // avoidEntryIife the collision is renamed away and no IIFE is emitted... expect(read("avoid.mjs")).not.toContain(MARKER); // ...while disabling the optimization keeps the per-entry IIFE. expect(read("keep.mjs")).toContain(MARKER); });