You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
In my question it was shown how to load an image inside a main file (eg.: page-index, page-contact, etc) using the direct require of the image or template mode of an HTML file with the image tag.
However, on my site I used a partial (nav.html) to insert an image, and using <%= require('../../partials/nav.html?raw') %> didn't work (dont load the image), but by changing to <%= require('../../partials/nav.html?template').default %> the image loaded correctly along with the code.
Is this way correct? I ask this because this repository is helping me a lot to make a website, but this is the first time I use Webpack and I have no idea how the html-loader works.
And when I run npm run build, the images inside index.html are not in an img folder, but directly in the root.
The text was updated successfully, but these errors were encountered:
In my question it was shown how to load an image inside a main file (eg.: page-index, page-contact, etc) using the direct require of the image or template mode of an HTML file with the image tag.
However, on my site I used a partial (nav.html) to insert an image, and using
<%= require('../../partials/nav.html?raw') %>
didn't work (dont load the image), but by changing to<%= require('../../partials/nav.html?template').default %>
the image loaded correctly along with the code.Is this way correct? I ask this because this repository is helping me a lot to make a website, but this is the first time I use Webpack and I have no idea how the html-loader works.
And when I run
npm run build
, the images inside index.html are not in an img folder, but directly in the root.The text was updated successfully, but these errors were encountered: