/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/parser-sources-disable/webpack.config.js
25 строк
593 B
Alexander Akait
Experimental HTML: parser/generator options, compilation hooks, and fixes (#21441)
19 июл 2026, 23:58
Не верифицирован
19 июл 2026, 23:58
cb904da
Код
Авторство
О чём код?
"use strict"; // `"..."` keeps every built-in source, and `type: false` disables one of them — // here the built-in `<img src>` — while a custom `data-src` is added. So the // default `src` is left untouched and only `data-src` is rewritten. /** @type {import("../../../../").Configuration} */ module.exports = { output: { assetModuleFilename: "[name][ext]" }, module: { parser: { html: { sources: [ "...", { tag: "img", attribute: "src", type: false }, { tag: "img", attribute: "data-src", type: "src" } ] } } }, experiments: { html: true } };