Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: specify vite as peer dep #7

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

achou11
Copy link

@achou11 achou11 commented Feb 11, 2025

when creating plugins, you should specify the versions of vite that are compatible with the plugin by declaring it as a peer dependency. doing it as a peer instead of a direct dep is preferred as it allows the end-user to dictate the version of vite that's used in the project. this will also be helpful towards #5

this also:

  • updates @vitejs/plugin-basic-ssl to the latest version in order to have proper compatibility with vite@6.
  • updates @vitejs/plugin-legacy to latest

the noted compatible versions of vite that i've set here are kind of arbitrary. not really sure what the ideal is aside from the latest major, but figured that this plugin is very likely compatible with vite@5 as well so it'd be worth allowing that for the sake of easier adoption. EDIT: nevermind, it probably needs to be v6 only since @vitejs/plugin-legacy requires v6 as a peer dep

"@vitejs/plugin-basic-ssl": "^1.1.0",
"@vitejs/plugin-legacy": "^6.0.0",
"@vitejs/plugin-basic-ssl": "^1.2.0",
"@vitejs/plugin-legacy": "^6.0.1",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically out of scope but figured why not 🤷‍♂️

"@vitejs/plugin-basic-ssl": "^1.1.0",
"@vitejs/plugin-legacy": "^6.0.0",
"@vitejs/plugin-basic-ssl": "^1.2.0",
"@vitejs/plugin-legacy": "^6.0.1",
"eruda": "^3.4.1",
"terser": "^5.36.0",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious if terser is needed as an explicit dep?

"devDependencies": {
"@webxdc/types": "latest",
"prettier": "latest",
"typescript": "latest",
"vite": "latest"
"vite": "6.1.0"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally better practice to specify a more explicit version range. can revert if not desired though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant