Open karlhorky opened 2 years ago
@karlhorky
gatsby-remark-copy-relative-linked-files
is a plugin created to compensate for the missing behavior in gatsby-remark-copy-linked-files
.
Therefore, gatsby-remark-copy-relative-linked-files
may be deprecated if gatsby-remark-copy-linked-files
has equivalent functionality.
Please let me know when a version of gatsby-remark-copy-linked-files
is released that confirms the merged functionality. I would like to use that functionality too, so I will check the behavior.
Sure, will do! I imagine the new version 5.24.0
will be released within a week.
So gatsby-remark-copy-linked-files@5.24.0
does indeed have equivalent functionality (at least for our project).
However, there is an unusual bug with it right now, which makes it a bit more involved to configure:
{
resolve: 'gatsby-remark-copy-linked-files',
options: {
destinationDir: (f: {
name: string;
hash: string;
absolutePath: string;
}) =>
// Avoid errors when Gatsby calls function using this data:
// { name: n, hash: h, absolutePath: a }
// https://github.com/gatsbyjs/gatsby/pull/36213#issuecomment-1279789118
!f.absolutePath.includes('/')
? `${f.hash}/${f.name}`
: `${path.dirname(
path.relative(
path.join(__dirname, 'src', 'pages'),
f.absolutePath,
),
)}/${f.name}-${f.hash}`,
},
},
So maybe it makes sense to wait until this is resolved and the ternary is no longer needed.
Chiming in a bit here because I came here just to try out this package because I noticed it does have one feature that the official one doesn't: Support for source
tags. For videos, responsive images, etc. the official plugin is woefully incomplete
Hi @akabekobeko ! 👋 Hope you are well.
I have worked on a PR for
gatsby-remark-copy-linked-files
for a while now, and it finally got merged:https://github.com/gatsbyjs/gatsby/pull/36213
This allows for specifying a relative destination dir, which may make
gatsby-remark-copy-relative-linked-files
obsolete:What are your thoughts on this?
Should
gatsby-remark-copy-relative-linked-files
be deprecated (along with a link togatsby-remark-copy-linked-files
)?