when I'm trying to reference an image in my react component in the render method as follows.
const leaderImgSrc = require('myimage.jpg');
and then in the TSX
<img src={leaderImgSrc} alt='an image' />
The following error message is returned in the browser
Error: Unable to load web part script resources due to: Error: Cannot find module "myimage.jpg". at https://localhost:4321/node_modules/@microsoft/sp-client-preview/dist/sp-client-preview.js:18185:32
I have included
require('set-webpack-public-path!');
in my component.
I've also tried adding the require statement directly into the src attribute, but that still has the same error.
I'm using Drop 5