parcel-bundler/parcel

Treat image set as href target as an asset instead of entry point

Open

#1917 opened on Aug 21, 2018

View on GitHub
 (11 comments) (0 reactions) (0 assignees)JavaScript (44,030 stars) (2,274 forks)batch import
:raising_hand_woman: FeatureGood First Issue

Description

❔ Question

Can images that are the target of an anchor link be bundled treated like assets instead of entry points by Parcel ?

🔦 Context

Since assets are moved to the root of the site by Parcel, I would like to do the same with other images. In this case, full-size images aren't displayed on the website but instead displayed only to users that click on the thumbnail (using Photoswipe).

💻 Code Sample

<a href="images/foo.jpeg" itemprop="contentUrl">
    <img src="images/foo_400w.jpeg">
</a>

Both foo_400w.jpeg & foo.jpeg should be in the same location.

🌍 Your Environment

Software Version(s)
Parcel 1.9.7
Node 10.6.0
npm/Yarn 1.9.4
Operating System depends

Contributor guide