using private NPM packages #58
-
First, just want to say this is an amazing project! 🙏 I'm curious if there is an idiomatic way to include private NPM dependencies? Would this just require hosting them in a custom registry or possibly bundling the code somehow alongside in a hidden file? Appreciate any help or guidance! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
You need to customize 3 places to support private npm registry:
|
Beta Was this translation helpful? Give feedback.
-
We talked about supporting private/local packages in sandpack, but the problem is a bit more complicated, with the bundler being pretty old at this stage and requiring a lot of changes. CodeSandbox has support for private packages on the Pro accounts, so it would be an option to allow sandpack users to connect to their codesandbox accounts. However, sandpack is intended to be a public code editor with a built-in bundler, so we're not sure on the use cases for private packages. Finally, it is possible to pass the bundled code, as if you were passing a files inside node_modules, so |
Beta Was this translation helpful? Give feedback.
-
Hey, for those who are interested in this feature, we recently released a new possible way to consume private packages, but it requires self-hosting another server: https://sandpack.codesandbox.io/docs/guides/private-packages#self-host-the-proxy Meanwhile, we're working on an enterprise solution that will make it easier to consume those packages without any extra service, but fees might be expected. 🚀 |
Beta Was this translation helpful? Give feedback.
-
I know I'm late to the party, but here is a simple script:
What it will do it basically is take files from Then in the sandpack:
If tour library depends on some external packages:
It's slow but it's working |
Beta Was this translation helpful? Give feedback.
Hey, for those who are interested in this feature, we recently released a new possible way to consume private packages, but it requires self-hosting another server: https://sandpack.codesandbox.io/docs/guides/private-packages#self-host-the-proxy
Meanwhile, we're working on an enterprise solution that will make it easier to consume those packages without any extra service, but fees might be expected.
🚀