Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to import images #40

Closed
Akshay090 opened this issue Jun 15, 2020 · 3 comments
Closed

Not able to import images #40

Akshay090 opened this issue Jun 15, 2020 · 3 comments
Labels
status: needs more info Needs triaging and reproducible examples or more information to be resolved type: question or discussion Issue discussing or asking a question

Comments

@Akshay090
Copy link

Akshay090 commented Jun 15, 2020

webpack gives error for importing images in react

@abhijithvijayan abhijithvijayan added status: needs more info Needs triaging and reproducible examples or more information to be resolved type: question or discussion Issue discussing or asking a question labels Jun 15, 2020
@abhijithvijayan
Copy link
Owner

abhijithvijayan commented Jun 15, 2020

@Akshay090 You don't have to import image assets, webpack automatically copies source/assets folder to build directory under assets folder.

Copy the image to source/assets folder and use it with

<img src="assets/logo.jpg" />

Feel free to reopen this if the issue still persist.

@Akshay090
Copy link
Author

oh I didn't knew that. I don't think there would be any special benefit to import image as we typically do in normal react app. Your method of doing it is good.

@abhijithvijayan
Copy link
Owner

create-react-app has loaders to handle the asset imports.

I didnt want to add more loaders to the boilerplate as webextensions usually do not require much of images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs more info Needs triaging and reproducible examples or more information to be resolved type: question or discussion Issue discussing or asking a question
Projects
None yet
Development

No branches or pull requests

2 participants