Description
Is your feature request related to a problem? Please describe
Currently, developing and testing custom remark plugins locally is unnecessarily complicated due to two main issues:
-
Module Resolution Conflict: When passing a resolved remark plugin, the module loader bypasses the local version and assumes I have a package installed and tries to resolve it by the key 🙄.
-
Forced Package Resolution: Even after working around the initial
import
check, the compiledmdc-imports.mjs
file still attempts to resolve plugins via the key specified in the Nuxt Content config, ignoring locally provided implementations.
Technical demonstration of the issue:
Describe the solution you'd like
We need the ability to use local remark plugins without the requirement to:
- Publish a package
- Configure package.json resolutions
- Switch from TypeScript to JavaScript
- Set up transpilation
Ideal implementation would look like this:
// content-plugins/remark-jess-has-a-plugin.ts
export default function myPlugin() {
}
// Nuxt Config
import remarkPublicThingyPlugin from 'remark-public-thingy'
import remarkJessHasAPlugin from './content-plugins/remark-jess-has-a-plugin'
export default defineNuxtConfig({
content: {
markdown: {
remarkPlugins: {
'remark-public-thingy': remarkPublicThingyPlugin,
'remark-jess-has-a-plugin': myPlugin,
}
}
}
})
Additional context
This feature would greatly improve the developer experience for:
- Rapid prototyping of remark plugins
- Testing modifications before publishing
- Local-only customizations