/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/generate-error/webpack.config.js
52 строки
990 B
Raj Aryan
test(html): cover generateError, ignored-source, and null-character parse paths (#21328)
03 июл 2026, 15:05
Не верифицирован
03 июл 2026, 15:05
0e43c4a
Код
Авторство
О чём код?
"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 }, module: { rules: [ { test: /page\.html$/, enforce: "pre", loader: path.resolve(__dirname, "error-loader.js") } ] }, optimization: { emitOnErrors: true }, bail: false, experiments: { html: true }, 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) ); } ); }); } } ] };