0

I have a prebuilt es5 module (say library) that has the following structure:

node_modules
|
`- library
    |
    `- build
        |
        `- images
        |   - img1.svg
        |   - img2.svg
        |   - logo.svg
        |    ...
        ` - package.json
        ` - index.js

library module exports ui components including Logo that renders an img element:

<img src="/images/logo.svg">

When I'm using Logo in CRA app, an /images/logo.svg path is not resolved correctly and Logo displays an empty image. Is there any way to copy library images and resolve paths during the build step? Wish to avoid copying images into /public folder manually as well as ejecting CRA.

Thanks in advance.

oozywaters
  • 1,171
  • 1
  • 8
  • 17

0 Answers0