adopt registerAndGetAmdImageURL

fixes #80563
This commit is contained in:
isidor
2019-09-09 18:15:03 +02:00
parent 0041358aee
commit a33e554693
8 changed files with 91 additions and 80 deletions

View File

@@ -194,7 +194,9 @@ function inlineAmdImages(src, result) {
const repoLocation = path.join(src, imagePath);
const absoluteLocation = path.join(REPO_ROOT_PATH, repoLocation);
if (!fs.existsSync(absoluteLocation)) {
throw new Error(`Invalid amd image url in file ${sourceFile.path}: ${imagePath}`);
const message = `Invalid amd image url in file ${sourceFile.path}: ${imagePath}`;
console.log(message);
throw new Error(message);
}
const fileContents = fs.readFileSync(absoluteLocation);
const mime = /\.svg$/.test(imagePath) ? 'image/svg+xml' : 'image/png';