/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/HtmlEntryWrapper.unittest.js
37 строк
1 KB
Alexander Akait
perf: load webpack's own modules only when a build needs them (#21652)
10 авг 2026, 07:32
Не верифицирован
10 авг 2026, 07:32
8e28763
Код
Авторство
О чём код?
"use strict"; const path = require("path"); const { Volume, createFsFromVolume } = require("memfs"); const webpack = require("../lib/index"); /** @typedef {import("../lib/util/fs").OutputFileSystem} OutputFileSystem */ // The entry hook builds the page before the first compilation, so nothing loaded // at a compilation boundary is warm — this must stay the process's first build. describe("output.html with a JavaScript entry", () => { it("should wrap the entry before the first compilation", (done) => { const context = path.resolve(__dirname, "fixtures"); const compiler = webpack({ mode: "development", context, entry: "./a.js", experiments: { html: true }, output: { path: "/out", html: { title: "Title" } } }); compiler.outputFileSystem = /** @type {OutputFileSystem} */ ( /** @type {unknown} */ (createFsFromVolume(new Volume())) ); compiler.run((err, stats) => { if (err) return done(err); const { errors } = /** @type {import("../lib/Stats")} */ (stats).toJson({ all: false, errors: true }); expect(errors).toEqual([]); compiler.close(done); }); }); });