/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/inline-chunk-hash/webpack.config.js
46 строк
1 KB
Raj Aryan
test(html): cover parser tree-construction edge cases and generator fallbacks (#21631)
10 авг 2026, 12:16
Не верифицирован
10 авг 2026, 12:16
57f8dcf
Код
Авторство
О чём код?
"use strict"; const fs = require("fs"); const path = require("path"); const webpack = require("../../../../"); /** @type {import("../../../../").WebpackPluginInstance} */ const copyTest = { apply(compiler) { compiler.hooks.compilation.tap("Test", (compilation) => { compilation.hooks.processAssets.tap( { name: "copy-test", stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL }, () => { compilation.emitAsset( "test.js", new webpack.sources.RawSource( fs.readFileSync(path.resolve(__dirname, "test.js")) ) ); } ); }); } }; /** @type {import("../../../../").Configuration} */ module.exports = { target: "web", mode: "development", entry: { main: "./src.js" }, output: { filename: "[name].js", htmlFilename: "main.html", // Inlining resolves each chunk through a sentinel carrying its hash; in // development the chunk carries no content hash, so the fallback runs. html: { inline: true } }, experiments: { html: true, css: true }, plugins: [copyTest] };