@astrojs/mdx 3.1.6 → 3.1.8
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.
- package/dist/vite-plugin-mdx.js +3 -7
- package/package.json +9 -9
package/dist/vite-plugin-mdx.js
CHANGED
|
@@ -5,6 +5,7 @@ import { createMdxProcessor } from "./plugins.js";
|
|
|
5
5
|
import { parseFrontmatter } from "./utils.js";
|
|
6
6
|
function vitePluginMdx(mdxOptions) {
|
|
7
7
|
let processor;
|
|
8
|
+
let sourcemapEnabled;
|
|
8
9
|
return {
|
|
9
10
|
name: "@mdx-js/rollup",
|
|
10
11
|
enforce: "pre",
|
|
@@ -12,10 +13,7 @@ function vitePluginMdx(mdxOptions) {
|
|
|
12
13
|
processor = void 0;
|
|
13
14
|
},
|
|
14
15
|
configResolved(resolved) {
|
|
15
|
-
|
|
16
|
-
processor = createMdxProcessor(mdxOptions, {
|
|
17
|
-
sourcemap: !!resolved.build.sourcemap
|
|
18
|
-
});
|
|
16
|
+
sourcemapEnabled = !!resolved.build.sourcemap;
|
|
19
17
|
const jsxPluginIndex = resolved.plugins.findIndex((p) => p.name === "astro:jsx");
|
|
20
18
|
if (jsxPluginIndex !== -1) {
|
|
21
19
|
resolved.plugins.splice(jsxPluginIndex, 1);
|
|
@@ -37,9 +35,7 @@ function vitePluginMdx(mdxOptions) {
|
|
|
37
35
|
const vfile = new VFile({ value: frontmatterLines + pageContent, path: id });
|
|
38
36
|
setVfileFrontmatter(vfile, frontmatter);
|
|
39
37
|
if (!processor) {
|
|
40
|
-
|
|
41
|
-
"MDX processor is not initialized. This is an internal error. Please file an issue."
|
|
42
|
-
);
|
|
38
|
+
processor = createMdxProcessor(mdxOptions, { sourcemap: sourcemapEnabled });
|
|
43
39
|
}
|
|
44
40
|
try {
|
|
45
41
|
const compiled = await processor.process(vfile);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/mdx",
|
|
3
3
|
"description": "Add support for MDX pages in your Astro site",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"es-module-lexer": "^1.5.4",
|
|
33
33
|
"estree-util-visit": "^2.0.0",
|
|
34
34
|
"gray-matter": "^4.0.3",
|
|
35
|
-
"hast-util-to-html": "^9.0.
|
|
35
|
+
"hast-util-to-html": "^9.0.3",
|
|
36
36
|
"kleur": "^4.1.5",
|
|
37
37
|
"rehype-raw": "^7.0.0",
|
|
38
38
|
"remark-gfm": "^4.0.0",
|
|
@@ -40,30 +40,30 @@
|
|
|
40
40
|
"source-map": "^0.7.4",
|
|
41
41
|
"unist-util-visit": "^5.0.0",
|
|
42
42
|
"vfile": "^6.0.3",
|
|
43
|
-
"@astrojs/markdown-remark": "5.
|
|
43
|
+
"@astrojs/markdown-remark": "5.3.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"astro": "^4.8.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/estree": "^1.0.
|
|
49
|
+
"@types/estree": "^1.0.6",
|
|
50
50
|
"@types/hast": "^3.0.4",
|
|
51
51
|
"@types/mdast": "^4.0.4",
|
|
52
52
|
"cheerio": "1.0.0",
|
|
53
|
-
"linkedom": "^0.18.
|
|
53
|
+
"linkedom": "^0.18.5",
|
|
54
54
|
"mdast-util-mdx": "^3.0.0",
|
|
55
55
|
"mdast-util-mdx-jsx": "^3.1.3",
|
|
56
56
|
"mdast-util-to-string": "^4.0.0",
|
|
57
57
|
"rehype-mathjax": "^6.0.0",
|
|
58
58
|
"rehype-pretty-code": "^0.14.0",
|
|
59
59
|
"remark-math": "^6.0.0",
|
|
60
|
-
"remark-rehype": "^11.1.
|
|
60
|
+
"remark-rehype": "^11.1.1",
|
|
61
61
|
"remark-shiki-twoslash": "^3.1.3",
|
|
62
62
|
"remark-toc": "^9.0.0",
|
|
63
|
-
"shiki": "^1.
|
|
63
|
+
"shiki": "^1.22.0",
|
|
64
64
|
"unified": "^11.0.5",
|
|
65
|
-
"vite": "^5.4.
|
|
66
|
-
"astro": "4.
|
|
65
|
+
"vite": "^5.4.8",
|
|
66
|
+
"astro": "4.16.0",
|
|
67
67
|
"astro-scripts": "0.0.14"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|