@astrojs/markdoc 1.0.0-beta.7 → 1.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import path from "node:path";
3
3
  import { fileURLToPath, pathToFileURL } from "node:url";
4
4
  import { parseFrontmatter } from "@astrojs/markdown-remark";
5
5
  import Markdoc from "@markdoc/markdoc";
6
+ import { emitClientAsset } from "astro/assets/utils";
6
7
  import { emitImageMetadata } from "astro/assets/utils/node";
7
8
  import { htmlTokenTransform } from "./html/transform/html-token-transform.js";
8
9
  import { setupConfig } from "./runtime.js";
@@ -237,7 +238,8 @@ async function emitOptimizedImages(nodeChildren, ctx) {
237
238
  if (shouldOptimizeImage(node.attributes.src)) {
238
239
  const resolved = await ctx.pluginContext.resolve(node.attributes.src, ctx.filePath);
239
240
  if (resolved?.id && fs.existsSync(new URL(prependForwardSlash(resolved.id), "file://"))) {
240
- const src = await emitImageMetadata(resolved.id, ctx.pluginContext.emitFile);
241
+ const fileEmitter = ctx.pluginContext.meta.watchMode ? void 0 : (opts) => emitClientAsset(ctx.pluginContext, opts);
242
+ const src = await emitImageMetadata(resolved.id, fileEmitter);
241
243
  const fsPath = resolved.id;
242
244
  if (src) {
243
245
  if (ctx.astroConfig.output === "static") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/markdoc",
3
3
  "description": "Add support for Markdoc in your Astro site",
4
- "version": "1.0.0-beta.7",
4
+ "version": "1.0.0-beta.9",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -60,8 +60,8 @@
60
60
  "esbuild": "^0.25.0",
61
61
  "github-slugger": "^2.0.0",
62
62
  "htmlparser2": "^10.1.0",
63
- "@astrojs/internal-helpers": "0.8.0-beta.0",
64
- "@astrojs/markdown-remark": "7.0.0-beta.4",
63
+ "@astrojs/internal-helpers": "0.8.0-beta.1",
64
+ "@astrojs/markdown-remark": "7.0.0-beta.6",
65
65
  "@astrojs/prism": "4.0.0-beta.2"
66
66
  },
67
67
  "peerDependencies": {
@@ -72,7 +72,7 @@
72
72
  "devalue": "^5.6.2",
73
73
  "linkedom": "^0.18.12",
74
74
  "vite": "^7.3.1",
75
- "astro": "6.0.0-beta.7",
75
+ "astro": "6.0.0-beta.10",
76
76
  "astro-scripts": "0.0.14"
77
77
  },
78
78
  "engines": {