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:
parent
4ae8fc91fa
commit
fb34e285fc
1 changed files with 4 additions and 1 deletions
|
@ -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));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue