diff --git a/.changeset/serious-icons-invent.md b/.changeset/serious-icons-invent.md new file mode 100644 index 000000000..5325a34d7 --- /dev/null +++ b/.changeset/serious-icons-invent.md @@ -0,0 +1,5 @@ +--- +'@astrojs/markdown-support': patch +--- + +Fix the importing of `unified` `Plugin` and `UnifiedPlugin` types diff --git a/packages/markdown-support/src/load-plugins.ts b/packages/markdown-support/src/load-plugins.ts index 5b24f14f6..6d30e8361 100644 --- a/packages/markdown-support/src/load-plugins.ts +++ b/packages/markdown-support/src/load-plugins.ts @@ -1,4 +1,4 @@ -import unified from 'unified'; +import * as unified from 'unified'; import type { Plugin, UnifiedPluginImport } from './types'; async function importPlugin(p: string | UnifiedPluginImport): UnifiedPluginImport { diff --git a/packages/markdown-support/src/types.ts b/packages/markdown-support/src/types.ts index e263bcd4d..be73db6a5 100644 --- a/packages/markdown-support/src/types.ts +++ b/packages/markdown-support/src/types.ts @@ -1,4 +1,4 @@ -import unified from 'unified'; +import * as unified from 'unified'; export type UnifiedPluginImport = Promise<{ default: unified.Plugin }>; export type Plugin = string | [string, any] | UnifiedPluginImport | [UnifiedPluginImport, any];