vitepress-plugin-sandpack
vitepress-plugin-sandpack copied to clipboard
Local dependencies
Hi, thank you for this library.
How can we import local dependencies similar to what we have here: https://sandpack.codesandbox.io/docs/guides/local-dependencies
similar to the below:
import designSystemRaw from "../design-system/build-sandpack?raw";
<Sandpack
files={{
"/App.tsx": `import { Button, Tag } from "@internals/ds";
export default function Sample() {
return (
<>
<Button type="primary">Button1</Button>
<Button type="secondary">Button2</Button>
<Tag>Tag</Tag>
</>
);
}
`,
"/node_modules/@internals/design-system/package.json": {
hidden: true,
code: JSON.stringify({
name: "@design-system",
main: "./index.js",
}),
},
"/node_modules/@internals/design-system/index.js": {
hidden: true,
code: designSystemRaw,
},
}}
template="react-vite"
/>
@husayt, I recently came across to this library while building examples for my library. But I am unable to import local dependency in the config. I could not find any solution or any workaround for this issue.
I am so sorry about it, it does not support it now.