R
R
Renhor2019-04-03 17:55:43
webpack
Renhor, 2019-04-03 17:55:43

Is there a shorter way to write file paths?

Good afternoon! A project in the src folder, in which the following hierarchy is:
src
-assets
--images
-components
--pages
-scripts
And to get an image in a file from the Pages folder, for example, I have to write something like this:
"./../ ../assets/images/img.png"
Is there a way to go directly from the root (in this case the src folder) - "/assets/images/img.png" ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Spirin, 2019-04-03
@Renhor

resolve.alias

S
Svetlana Galenko, 2019-04-03
@swallow_97

Good afternoon! You can write like this:
<img src="../images/img.png" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question