@@ -8,13 +8,15 @@ import path from "path"
8
8
import json from "@rollup/plugin-json"
9
9
import del from "rollup-plugin-delete"
10
10
import replace from "@rollup/plugin-replace"
11
+ import dts from "rollup-plugin-dts" ;
11
12
import { nodeResolve } from "@rollup/plugin-node-resolve"
12
13
// import { terser } from "rollup-plugin-terser"
13
14
import commonjs from "@rollup/plugin-commonjs"
14
15
15
16
const clientExternal = [
16
17
"react" ,
17
18
"react-dom" ,
19
+ "remark/config" ,
18
20
// "@codesandbox/sandpack-client",
19
21
// "use-spring",
20
22
// "diff",
@@ -72,6 +74,12 @@ export default function makeConfig(commandOptions) {
72
74
} ) ,
73
75
] ,
74
76
} ,
77
+ {
78
+ input : `src/index.tsx` ,
79
+ output : [ { file : `./dist/index.d.ts` , format : "es" } ] ,
80
+ external : [ ...remarkExternal , "shiki" ] ,
81
+ plugins : [ dts ( ) ] ,
82
+ } ,
75
83
// for the browser esm we need to replace shiki with shiki/dist/index.browser.mjs
76
84
// https://github.com/shikijs/shiki/issues/131#issuecomment-1094281851
77
85
{
@@ -125,5 +133,11 @@ export default function makeConfig(commandOptions) {
125
133
} ) ,
126
134
] ,
127
135
} ,
136
+ {
137
+ input : `src/components.tsx` ,
138
+ output : [ { file : `./dist/components.d.ts` , format : "es" } ] ,
139
+ external : clientExternal ,
140
+ plugins : [ dts ( ) ] ,
141
+ } ,
128
142
]
129
143
}
0 commit comments