Skip to content

Commit 3c9f3f7

Browse files
committed
Patch mdx bundler
1 parent 6abaadd commit 3c9f3f7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/mdx/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
"./styles": "./dist/index.css",
2323
"./styles.css": "./dist/index.css",
2424
"./dist/index.css": "./dist/index.css",
25-
"./dist/components.cjs": "./dist/components.cjs.js"
25+
"./dist/components.cjs.js": {
26+
"import": "./dist/components.esm.js",
27+
"require": "./dist/components.cjs.js",
28+
"default": "./dist/components.cjs.js"
29+
}
2630
},
2731
"scripts": {
2832
"dev": "next",

packages/mdx/src/mdx-plugin/plugin.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ function addConfig(
105105
function addImportNode(tree: SuperNode) {
106106
tree.children.unshift({
107107
type: "mdxjsEsm",
108-
value: 'import { CH } from "@code-hike/mdx/components"',
108+
value:
109+
'import { CH } from "@code-hike/mdx/dist/components.cjs.js"',
109110
data: {
110111
estree: {
111112
type: "Program",
@@ -127,8 +128,9 @@ function addImportNode(tree: SuperNode) {
127128
],
128129
source: {
129130
type: "Literal",
130-
value: "@code-hike/mdx/components",
131-
raw: '"@code-hike/mdx/components"',
131+
value:
132+
"@code-hike/mdx/dist/components.cjs.js",
133+
raw: '"@code-hike/mdx/dist/components.cjs.js"',
132134
},
133135
},
134136
],

0 commit comments

Comments
 (0)