/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/helpers/readMinifiedSections.js
20 строк
695 B
Alexander Akait
feat(minify): more safe CSS/HTML transforms, with the name tables generated (#21581)
02 авг 2026, 13:05
Не верифицирован
02 авг 2026, 13:05
23420d3
Код
Авторство
О чём код?
"use strict"; const fs = require("fs"); const path = require("path"); /** * Read a minified CSS asset and split it into one entry per `/*!` label. The * corpus fixtures put a kept comment before every case, so a snapshot shows — * and diffs — one case per line instead of one very long line. * @param {string} outputPath the compilation's output directory * @param {string} name the asset's filename * @returns {string[]} the labelled sections, in source order */ const readMinifiedSections = (outputPath, name) => fs .readFileSync(path.join(outputPath, name), "utf8") .split(/(?=\/\*! )/u) .filter((section) => section.length !== 0); module.exports = readMinifiedSections;