Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local dependencies #5

Open
husayt opened this issue Nov 23, 2023 · 2 comments
Open

Local dependencies #5

husayt opened this issue Nov 23, 2023 · 2 comments

Comments

@husayt
Copy link

husayt commented Nov 23, 2023

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"
/>
@Ashish-simpleCoder
Copy link

@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.

@jerrywu001
Copy link
Owner

I am so sorry about it, it does not support it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants