/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/initial-chunk-modulepreload-polyfill-disabled/test.js
12 строк
612 B
Alexander Akait
feat: add output.resourceHints (preload / prefetch / modulepreload / preconnect emission) (#21463)
21 июл 2026, 13:46
Не верифицирован
21 июл 2026, 13:46
ece0fcb
Код
Авторство
О чём код?
const fs = require("fs"); const path = require("path"); const page = fs.readFileSync(path.resolve(__dirname, "page.html"), "utf-8"); it("should emit modulepreload links but no inline polyfill when resourceHints.modulePreloadPolyfill is false", () => { // The `<link rel="modulepreload">` tags are still emitted. expect(page).toContain('<link rel="modulepreload" href="runtime.mjs">'); // ...but the inline ES5 polyfill <script> is suppressed (strict CSP). expect(page).not.toMatch(/<script>\(function\(\)\{[\s\S]*?modulepreload/); expect(page).not.toContain('document.createElement("link").relList'); });