/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/source-dependency-loader/index.js
18 строк
643 B
Alexander Akait
Experimental HTML: parser/generator options, compilation hooks, and fixes (#21441)
19 июл 2026, 23:58
Не верифицирован
19 июл 2026, 23:58
cb904da
Код
Авторство
О чём код?
const fs = require("fs"); const path = require("path"); const page = require("./page.html"); const read = (name) => fs.readFileSync(path.resolve(__dirname, name), "utf-8"); it("should rewrite the <img src> to the emitted asset", () => { expect(page).not.toContain('src="./themed.svg"'); expect(page).toMatch(/src="themed\.svg"/); }); it("should attach a loader to HTML references via the `url` dependency condition", () => { const emitted = read("themed.svg"); // The loader selected by `dependency: "url"` ran on the referenced asset. expect(emitted).toContain('fill="#00ff00"'); expect(emitted).not.toContain("__DEP_COLOR__"); });