Skip to content

using private NPM packages #57

Closed
Closed

Description

@souporserious

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!

Activity

  1. ensorrow commented on Jun 4, 2021

    @ensorrow

    You need to customize 3 places to support private npm registry:

    1. An unpkg alike service to reach your private npm files' content directly by api
    2. Change the registry of dependency-packager and self host it
    3. Change the default cloudflare unpkg service and depencency-packager service to your customize service in codesandbox-client project and self host the dist code
  2. alexnm commented on Jun 4, 2021

    @alexnm
    Collaborator

    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

  3. locked and limited conversation to collaborators on Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions