Skip to content

How to change image url for subfolder projects? #69

@codestitch

Description

@codestitch

Hi.

In my HeaderComponent (located in src/components/navigation/) this is what it looks like when i include an image from images folder let yeomanImage = require('../../images/logo.png'); then use it <img className='img-header' src={yeomanImage}/>. It runs fine in dev server.

Now when I compiled my project to production. I changed my index.html in /dist folder from <script type="text/javascript" src="/assets/app.js"></script> to this <script type="text/javascript" src="./assets/app.js"></script>.

When I run the compiled project it can't seem to find the image.

capture

How do I change my require in getting the image?

Thanks for your help.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions