gatsby-remark-relative-images
gatsby-remark-relative-images copied to clipboard
Ensure absolute path exists
Resolves #38
Contentful allows for a field type of "Long Text". This is created as a MarkdownRemark
node. This node does not have a fileAbsolutePath
set (i.e., is null
). Invoking path.dirname
without a value throws the error shown in #38.
It appears as though the author was aware of nodes without this value populated existing, given the guard implemented here: https://github.com/danielmahon/gatsby-remark-relative-images/blob/3da59696cd3e0f8eb01f0376004a95d011d1f2e3/src/index.ts#L81-L83
This PR adds the same guard to the onCreateNode
definition