/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/optimization/minimize-javascript-only/test.config.js
20 строк
701 B
Alexander Akait
feat: configure or exclude each asset type's minifier via optimization.minimize (#21663)
10 авг 2026, 18:37
Не верифицирован
10 авг 2026, 18:37
5a8fa6c
Код
Авторство
О чём код?
"use strict"; const fs = require("fs"); const path = require("path"); module.exports = { findBundle(_i, options) { const files = fs.readdirSync(options.output.path); return files.includes("main.js") ? ["./main.js"] : undefined; }, afterExecute(options) { const read = (name) => fs.readFileSync(path.join(options.output.path, name), "utf8"); // JS was not excluded: minifying drops the marker comment. expect(read("main.js")).not.toContain("javascript minify marker"); // The excluded types keep the markers minifying would have dropped. expect(read("main.css")).toContain("css minify excluded marker"); expect(read("page.html")).toContain("html minify excluded marker"); } };