parcel-bundler/parcel

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

Aberta

#1.917 aberto em 21 de ago. de 2018

 (11 comentários) (0 reação) (0 responsável)JavaScript (2.274 forks)batch import
:raising_hand_woman: FeatureGood First Issue

Métricas do repositório

Stars
 (44.030 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

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

Guia do colaborador