/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/template-non-string/webpack.config.js
46 строк
927 B
Raj Aryan
test(html): cover HtmlParser template, webpackIgnore, svg-namespace, BOM, and unquoted-type paths (#21335)
06 июл 2026, 13:55
Не верифицирован
06 июл 2026, 13:55
c572a82
Код
Авторство
О чём код?
"use strict"; const fs = require("fs"); const path = require("path"); const webpack = require("../../../../"); /** @type {import("../../../../").Configuration} */ module.exports = { target: "web", entry: { page: "./src/page.html" }, output: { html: true }, optimization: { emitOnErrors: true }, bail: false, experiments: { html: true }, module: { parser: { html: { template() { return 42; } } } }, plugins: [ { apply(compiler) { compiler.hooks.compilation.tap("Test", (compilation) => { compilation.hooks.processAssets.tap( { name: "copy-test", stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL }, () => { const data = fs.readFileSync(path.resolve(__dirname, "test.js")); compilation.emitAsset( "test.js", new webpack.sources.RawSource(data) ); } ); }); } } ] };