/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/css/source-map-hidden-payload/index.js
25 строк
807 B
Alexander Akait
fix(css): name inlined CSS source map sources and honor hidden devtools (#21558)
30 июл 2026, 16:44
Не верифицирован
30 июл 2026, 16:44
029fd0f
Код
Авторство
О чём код?
import css from "./style.css"; const fs = __nodeFs; const path = __nodePath; // Referencing the export keeps the value-returning `text` module in the bundle. if (typeof css !== "string") throw new Error("expected the css text export"); const { outputPath } = __STATS__.children[__STATS_I__]; const bundle = fs.readFileSync( path.join(outputPath, `bundle${__STATS_I__}.js`), "utf-8" ); const hasInlineMap = /sourceMappingURL=data:application\/json/.test(bundle); if (__STATS_I__ === 2) { it("should inline a map into the css payload for source-map", () => { expect(hasInlineMap).toBe(true); }); } else { // the inlined map would otherwise ship the sources inside the bundle it("should not inline a map into the css payload for hidden devtools", () => { expect(hasInlineMap).toBe(false); }); }