DimiMikadze / create-react-library

React NPM library starter kit based on Facebook's create react app
MIT License
602 stars 60 forks source link

Can't import an image #12

Closed lightninglu10 closed 6 years ago

lightninglu10 commented 6 years ago

Hey guys, with the current dev webpack config, I can't import an image. It shows up as a data string that doesn't have any image output.

I changed the webpack.dev to the same as create-react-app and importing images in components work.

DimiMikadze commented 6 years ago

@lightninglu10 Hi, thanks for reporting.

Can you send PR for fixing this issue?

Anyway in the next week, we are going refactor this library to be global NPM package and this bug will be also fixed.

lightninglu10 commented 6 years ago

Hey I'm trying to submit a PR, but it won't let me push to this repo.

lightninglu10 commented 6 years ago

any update here? push access seems not allowed.

DimiMikadze commented 6 years ago

@lightninglu10 you can't push to directly to master, create new branch and send PR

lightninglu10 commented 6 years ago

I did, I tried to push to a new branch but it won’t let me.

Sent from my iPhone

On Dec 14, 2017, at 10:09 PM, Dimitri Mikadze notifications@github.com wrote:

@lightninglu10 you can't push to directly to master, create new branch and send PR

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mfyuce commented 6 years ago

Hi All,

Just sent a pull request for fixing the issue.

All the best.

rtmalone commented 6 years ago

@mfyuce I looked at your PR, does it make sense to utilize static/**/... so that however someone prefers to label/build their static dir structure, it'll still pick up the files?

I copied the src from one of my projects into this and I noted I had to either create the media dir or modify the webpack config myself to pick up my images.

DimiMikadze commented 6 years ago

HI guys,

We have updated our library with new version of create-react-app so importing files inside components works exactly as in cra

i'm closing this issue right now, because it's being resolved, but feel free to re open it, if needed