Skip to content

Make node-forge an optional dependency #8532

Closed
@patak-dev

Description

Clear and concise description of the problem

@sapphi-red made Terser an optional dep with:

@TrySound suggested that we do the same with node-forge. It is a big dependency (1.5MB) and it is only needed when creating an HTTP cert:

Suggested solution

We have two options:

  1. Make the dep optional leaving the functionality as-is. If the user doesn't include a cert, we'll ask them to install node-forge.
  2. Move the auto-generated HTTP cert logic to a new @vitejs/plugin-basic-ssl. See comment from @dominikg here fix: pregenerate https certificate #6173 (comment). Add documentation to explain how to properly generate certs and do a proper SSL setup (and link to the basic SSL plugin as an option, but not even the best)

I think 2. is better here. Opening the issue in case someone wants to work on it, I'll get to it if not before v3.

Alternative

No response

Additional context

No response

Validations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp3-significantHigh priority enhancement (priority)

    Type

    No type

    Projects

    • Status

      Discussing

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions