0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Removed assets/ from sources in admin sourcemaps (#18832)

no issue

- Follow up to https://github.com/TryGhost/Ghost/pull/18825
- Adding the sourceRoot key didn't seem to work, so I'm just removing
the `assets/` prefix from all the sources to hopefully correct the issue
This commit is contained in:
Chris Raible 2023-11-01 15:02:56 -07:00 committed by GitHub
parent 4ae8fc91fa
commit fb34e285fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,10 @@ module.exports = {
mapFiles.forEach((file) => {
const mapFilePath = path.join(results.directory, 'assets', file);
const mapFile = JSON.parse(fs.readFileSync(mapFilePath, 'utf8'));
mapFile.sourceRoot = '../';
const sources = mapFile.sources;
for (let i = 0; i < sources.length; i++) {
sources[i] = sources[i].replace('assets/', '');
}
fs.writeFileSync(mapFilePath, JSON.stringify(mapFile));
});
}