/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/auto-preconnect/test.js
13 строк
498 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"); const head = page.slice(0, page.indexOf("</head>")); it("should emit a preconnect link for the cross-origin publicPath origin", () => { expect(head).toContain( '<link rel="preconnect" href="https://cdn.example.com" crossorigin="anonymous">' ); // Only the origin, not the full path. expect(head).not.toContain('href="https://cdn.example.com/assets/"'); });