You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
You need to customize 3 places to support private npm registry:
An unpkg alike service to reach your private npm files' content directly by api
Change the registry of dependency-packager and self host it
Change the default cloudflare unpkg service and depencency-packager service to your customize service in codesandbox-client project and self host the dist code
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 /node_modules/<library>/index.js: . It is not ideal, as you move around a lot of code (depending on the size of the package) through the sandpack components, and it takes some time to create your setup
Activity
ensorrow commentedon Jun 4, 2021
You need to customize 3 places to support private npm registry:
alexnm commentedon Jun 4, 2021
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
/node_modules/<library>/index.js: . It is not ideal, as you move around a lot of code (depending on the size of the package) through the sandpack components, and it takes some time to create your setup