Parcel: It doesn't resolve image file pointed in src attribute of <amp-img> elements

Created on 7 Feb 2019  ยท  8Comments  ยท  Source: parcel-bundler/parcel

๐Ÿ› bug report

The entry point is a html file.
The bundler doen't seem to detect the resource file which is specified in <amp-img> tag's src attribute.
The path in output file is the same as the input file.

<amp-img src="/path/to/image.jpg">

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

parcel index.html

๐Ÿค” Expected Behavior

It should work as same as it does for <img> tag.

<amp-img src="/image.(hash goes here).jpg">

๐Ÿ˜ฏ Current Behavior

It doesn't.

๐Ÿ’ Possible Solution

Furthurmore, I think there should be no limitation of the tag name (or black-list instead of current black-list) on checking src attribute, because there are plenty types of amp elements using media file (See: Components - Amp).

๐Ÿ”ฆ Context


Parcel is now not friendly with AMP.

๐Ÿ’ป Code Sample

https://github.com/honey32/snippet-of-parcel-bug

๐ŸŒ Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.11.0
| Node | 8.9.3
| npm/Yarn | 5.5.1
| Operating System | Windows 10

All 8 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

Any update to this? I have the same issue

sorry, i'm not sure. I'm not dealing with a project related to this problem.

2020ๅนด6ๆœˆ12ๆ—ฅ(้‡‘) 16:02 BegoConstantino notifications@github.com:

Any update to this? I have the same issue

โ€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/parcel-bundler/parcel/issues/2622#issuecomment-643104728,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFMWPX73CRPHUROA3N22ODTRWHHJPANCNFSM4GU3OE4Q
.

I fixed it!
Just need to add 'amp-img' in the array of src to watch. File:
\node_modules\parcel-bundlersrc\assets\HTMLAsset.js

I don't know if we can do it by other way

thank you!
i appreciate your work.

2020ๅนด6ๆœˆ17ๆ—ฅ(ๆฐด) 16:01 BegoConstantino notifications@github.com:

I fixed it!
Just need to add 'amp-img' in the array of src to watch. File:
\node_modules\parcel-bundlersrc\assets\HTMLAsset.js

โ€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/parcel-bundler/parcel/issues/2622#issuecomment-645191321,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFMWPXZCQAH3OVRIQTI5LNLRXBS4FANCNFSM4GU3OE4Q
.

Maybe the file below is the same as one you mentioned.
parcel/packages/transformers/html/src/dependencies.js
However, i'm not sure if 'parcel' should support AMP.

It seems like the same file (in my installed parcel has more const defined at the begining)

Anyway. A simple AMP page is just as decorated html, 'parcel' has not problems to complie it. I did it and the amp-img src was the only error that I see.

I didn't try to make one with amp plugins

I'll make a Pull Request ... in the future.

Was this page helpful?
0 / 5 - 0 ratings