/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/source-map/devtools-default/index.js
28 строк
655 B
Sebastian Beltran
fix(css): name CSS sources in source maps by their resource path (#21536)
28 июл 2026, 17:18
Не верифицирован
28 июл 2026, 17:18
ff07bdc
Код
Авторство
О чём код?
import fs from "fs"; import path from "path"; import "./foo.css"; const readFile = (filename) => { let dirname; if (typeof window !== "undefined") { dirname = __STATS__.outputPath; } else { dirname = __dirname; } return fs.readFileSync(path.join(dirname, filename), "utf-8"); }; const getSourceMap = (filename) => { return JSON.parse(readFile(filename)); }; it("should compile successfully and have individual css sourcemap", async () => { let map = getSourceMap("bundle0.css.map"); expect(map.sources).toStrictEqual([ "webpack:///./bar.css", "webpack:///./foo.css" ]); expect(() => { readFile("bundle0.js.map"); }).toThrow(); });