I have issue with sharing images between two bundles. I import image in one bundle and then import that built bundle into another app. I've created the repo with example of what I got and what I need for more clarity.
Asked
Active
Viewed 28 times
0
-
Thanks for sharing your question - can you post the focus parts of your code here? I think it will produce better feedback. – Michael Nelles Apr 15 '20 at 11:04
-
I've looked at the repo. You're importing a jpg file and then returning the import results as a module.exports and in your main index.js you're executing it as a function..... What's the logic behind that? – Tschallacka Apr 15 '20 at 11:08
-
@Tschallacka In the original app, it's a react component that imports the image and then it's imported in an app. And it can be many components – kirusick Apr 15 '20 at 11:46
-
@ksmolniy but why `console.log(childModule());` you're executing a jpg file as a function? What are you trying to achieve? – Tschallacka Apr 15 '20 at 12:09
-
@Tschallacka I've added more clarity to code. Now child module creates an image element with my picture and the main package append it into the document. I need to webpack found image dependencies in the child module and add it to the main build folder – kirusick Apr 15 '20 at 12:31
-
Ahh, now I understand. Does this answer help you? https://stackoverflow.com/questions/27639005/how-to-copy-static-files-to-build-directory-with-webpack – Tschallacka Apr 15 '20 at 12:35
-
@Tschallacka little bit. I added Copy Webpack Plugin and it fixed my problem enough – kirusick Apr 15 '20 at 14:30