Closed mdcfe closed 3 years ago
@mdcfe, thanks so much for this PR. Can you see if my additional commits work for your use-case? It's a bit of a hack, but it maintains backward compatibility with the named export.
The downside is that this probably affects treeshaking, but since there will really only be one import, this seems fine. Don't know enough about this though.
On my end, nuxt-content
is still able to resolve and import remark-wiki-link
after adding the back the named export, so all good here. I'm not too knowledgable about treeshaking myself, but I'm not sure this would introduce any new issues given it's a single file module.
Great! Published in 1.0.4
. Thanks again for the contribution!
This PR changes
src/index.js
to use a default export instead of a named export. As noted in #12 this seems to be common behaviour for remark plugins, and I personally found this change was necessary to use this package withnuxt-content
(https://github.com/landakram/remark-wiki-link/issues/12#issuecomment-813043538), which assumes that the given plugin uses default exports.I notice
rollup
doesn't fail but gives this warning when building. The option it suggests suppresses the warning, but I'm not sure whether this is the best way to address this issue.I realise this is a breaking change, as any import lines will change. I've left the
package.json
version as-is to be bumped after merge.