This is a very old question, but, nevertheless, they brought me here. The solution I came across was to create a data URL for your local resource. In node.js:
const imageData = fs.readFileSync(path.join(__dirname, '../resources/logo.png'));
const base64Image = Buffer.from(imageData).toString('base64');
const inlinePng = {
name: 'logo.png',
contentType: 'image/png',
contentUrl: 'data:image/png;base64,${ base64Image }'
};
With svg you can skip base64 encoding:
const svgData = fs.readFileSync(path.join(__dirname, './resources/logo.svg'));
const inlineSvg = {
name: 'logo',
contentType: 'image/svg',
contentUrl: 'data:image/svg+xml;utf8,${ svgData }',
};
. Microsoft #.