/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/hotCases/css/link-insert-hook/webpack.config.js
33 строки
734 B
Alexander Akait
feat: add linkInsert hook to CssLoadingRuntimeModule (#20947)
12 май 2026, 16:39
Не верифицирован
12 май 2026, 16:39
0053c9f
Код
Авторство
О чём код?
"use strict"; const webpack = require("../../../../"); /** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", devtool: false, plugins: [ (compiler) => { compiler.hooks.thisCompilation.tap( "LinkInsertHookHmrTest", (compilation) => { const hooks = webpack.web.CssLoadingRuntimeModule.getCompilationHooks( compilation ); // Tag the link from inside the hook so we can verify the // hook's source is what the HMR runtime actually executes. hooks.linkInsert.tap( "LinkInsertHookHmrTest", (source) => `link.setAttribute("data-link-insert", "custom");\n${source}` ); } ); } ], experiments: { css: true } };