diff --git a/.changeset/config.json b/.changeset/config.json index 412f7a6b3..0c19bc500 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -15,7 +15,6 @@ "typedoc-github-wiki-theme", "typedoc-gitlab-wiki-theme", "typedoc-vitepress-theme", - "typedoc-plugin-remark", "typedoc-plugin-frontmatter" ] } diff --git a/.changeset/healthy-hats-joke.md b/.changeset/healthy-hats-joke.md new file mode 100644 index 000000000..94f457b72 --- /dev/null +++ b/.changeset/healthy-hats-joke.md @@ -0,0 +1,5 @@ +--- +'typedoc-plugin-remark': patch +--- + +- Fix windows ERR_UNSUPPORTED_ESM_URL_SCHEME error (#752). diff --git a/packages/typedoc-plugin-remark/src/index.ts b/packages/typedoc-plugin-remark/src/index.ts index 0ce93a18e..5f6ea990a 100644 --- a/packages/typedoc-plugin-remark/src/index.ts +++ b/packages/typedoc-plugin-remark/src/index.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import { DeclarationOption } from 'typedoc'; import { MarkdownApplication } from 'typedoc-plugin-markdown'; -import { fileURLToPath } from 'url'; +import { fileURLToPath, pathToFileURL } from 'url'; import { getDefaultPlugins } from './helpers/get-default-plugins.js'; import * as options from './options/declarations.js'; import { parse } from './parse.js'; @@ -48,7 +48,7 @@ export function load(app: MarkdownApplication) { ? tocPlugin[1] : {}; defaultPlugins.push([ - path.join(__dirname, 'plugins', 'add-toc.js'), + pathToFileURL(path.join(__dirname, 'plugins', 'add-toc.js')).href, { reflection: urlMapping.model, typedocOptions: app.options,