I
I
Itzakon2016-10-27 17:30:00
React
Itzakon, 2016-10-27 17:30:00

How to fix path issue in webpack?

My config
97413478fdea49faad4ce1cb65f350f1.png
My file structure
92f93df2c44e4e32bc054841e87d1904.png

<a href="#"><img src="../../images/googlePlay.png" alt="get it on Google Play" /></a>

This is how I import/require pictures. (I use this to avoid require ->
And I have the following problem with paths
Cannot resolve 'file' or 'directory' ../../images/appStore.png' in /home/***/Projects/***/frontend/src/components

What should I fix so that the path leads to home -> --> frontend/images/, or dist.
a feeling that for some reason he does not add the path.
Something like this)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Q
qtuz, 2016-10-31
@qtuz

Where does the error occur? In HTMLWebpackPlugin at frontend/src/index.ejsor at entry-point frontend/src/index.js?

U
UsulPro, 2016-11-23
@UsulPro

Purely offhand, judging by the folder structure in dist, images is on the same level as the JS file.
hence src="images/googlePlay.png"
if in frontend then apparently "../images/appStore.png"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question