Fix/markdoc assets (#7706)

This commit is contained in:
Erika 2023-07-18 18:03:46 +02:00 committed by GitHub
parent a77741d25e
commit 4f6b5ae2ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View file

@ -0,0 +1,6 @@
---
'@astrojs/markdoc': patch
'astro': patch
---
Fix Markdoc integration not being able to import `emitESMImage` from Astro

View file

@ -52,6 +52,7 @@
"./components": "./components/index.ts",
"./components/*": "./components/*",
"./assets": "./dist/assets/index.js",
"./assets/utils": "./dist/assets/utils/index.js",
"./assets/image-endpoint": "./dist/assets/image-endpoint.js",
"./assets/services/sharp": "./dist/assets/services/sharp.js",
"./assets/services/squoosh": "./dist/assets/services/squoosh.js",

View file

@ -0,0 +1 @@
export { emitESMImage } from './emitAsset.js';

View file

@ -6,9 +6,9 @@ import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import type { ErrorPayload as ViteErrorPayload } from 'vite';
import type { ComponentConfig } from './config.js';
import { isComponentConfig, isValidUrl, MarkdocError, prependForwardSlash } from './utils.js';
// @ts-expect-error Cannot find module 'astro/assets' or its corresponding type declarations.
import { emitESMImage } from 'astro/assets';
import { MarkdocError, isComponentConfig, isValidUrl, prependForwardSlash } from './utils.js';
// @ts-expect-error Cannot get the types here without `moduleResolution: 'nodenext'`
import { emitESMImage } from 'astro/assets/utils';
import path from 'node:path';
import type * as rollup from 'rollup';
import type { MarkdocConfigResult } from './load-config.js';