parcel-bundler/parcel

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

Open

#1,917 建立於 2018年8月21日

在 GitHub 查看
 (11 留言) (0 反應) (0 負責人)JavaScript (44,030 star) (2,274 fork)batch import
:raising_hand_woman: FeatureGood First Issue

描述

❔ 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

貢獻者指南