Fix/markdoc assets (#7706)
This commit is contained in:
parent
a77741d25e
commit
4f6b5ae2ba
4 changed files with 11 additions and 3 deletions
6
.changeset/smart-hairs-lick.md
Normal file
6
.changeset/smart-hairs-lick.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
'@astrojs/markdoc': patch
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix Markdoc integration not being able to import `emitESMImage` from Astro
|
|
@ -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",
|
||||
|
|
1
packages/astro/src/assets/utils/index.ts
Normal file
1
packages/astro/src/assets/utils/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export { emitESMImage } from './emitAsset.js';
|
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue