/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/initial-chunk-modulepreload-fetchpriority/test.js
15 строк
642 B
Alexander Akait
feat: extend analyzable ESM output to async WebAssembly and hinted refs (#21604)
05 авг 2026, 00:32
Не верифицирован
05 авг 2026, 00:32
7a19dd8
Код
Авторство
О чём код?
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 fetchpriority on auto initial-graph modulepreload hints", () => { // Parser-inserted hints are the one place a `fetchpriority` on a // `<link rel="modulepreload">` is honored — browsers ignore the attribute on // links injected at runtime, so webpack only emits it here. const tag = head.match(/<link rel="modulepreload"[^>]*>/)[0]; expect(tag).toContain('href="runtime.mjs"'); expect(tag).toContain('fetchpriority="high"'); });