Skip to content

using private NPM packages #401

Answered by danilowoz
gracegotlost asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, actually there is something wrong in your implementation:

export default function App() {
  return (
    <Sandpack
      template="react"
      files={{
        "/App.js": `import { A } from "@company/design-system";

export default function App() {
  return (<A />)
}`,

        // Dependencies
        "/node_modules/@company/design-system/package.json": JSON.stringify({
          name: "@company/design-system",
          main: "lib/index.js"
        }),
        "/node_modules/@company/design-system/lib/index.js": `
          // Importing a third file
          export { A } from "@company/design-system/src/A" 
        `,

        // Missing file
        "/node_modules/@company/design…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danilowoz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants