@@ -8,13 +8,15 @@ import path from "path"
88import json from "@rollup/plugin-json"
99import del from "rollup-plugin-delete"
1010import replace from "@rollup/plugin-replace"
11+ import dts from "rollup-plugin-dts" ;
1112import { nodeResolve } from "@rollup/plugin-node-resolve"
1213// import { terser } from "rollup-plugin-terser"
1314import commonjs from "@rollup/plugin-commonjs"
1415
1516const clientExternal = [
1617 "react" ,
1718 "react-dom" ,
19+ "remark/config" ,
1820 // "@codesandbox/sandpack-client",
1921 // "use-spring",
2022 // "diff",
@@ -72,6 +74,12 @@ export default function makeConfig(commandOptions) {
7274 } ) ,
7375 ] ,
7476 } ,
77+ {
78+ input : `src/index.tsx` ,
79+ output : [ { file : `./dist/index.d.ts` , format : "es" } ] ,
80+ external : [ ...remarkExternal , "shiki" ] ,
81+ plugins : [ dts ( ) ] ,
82+ } ,
7583 // for the browser esm we need to replace shiki with shiki/dist/index.browser.mjs
7684 // https://github.com/shikijs/shiki/issues/131#issuecomment-1094281851
7785 {
@@ -125,5 +133,11 @@ export default function makeConfig(commandOptions) {
125133 } ) ,
126134 ] ,
127135 } ,
136+ {
137+ input : `src/components.tsx` ,
138+ output : [ { file : `./dist/components.d.ts` , format : "es" } ] ,
139+ external : clientExternal ,
140+ plugins : [ dts ( ) ] ,
141+ } ,
128142 ]
129143}
0 commit comments