preactjs / create-preact

Create a Vite-powered Preact app in seconds
MIT License
46 stars 6 forks source link

fix: get package manager #22

Closed devjiwonchoi closed 7 months ago

devjiwonchoi commented 7 months ago

cc @rschristian

This PR added the get package manager method, which looks for process.env of npm_config_user_agent. This method is supported for yarn, npm, and pnpm.

P.S. create-next-app also uses this method

x-ref: https://github.com/pnpm/pnpm/pull/4317 x-ref: https://github.com/npm/cli/pull/1919 x-ref: https://github.com/yarnpkg/yarn/pull/7127 x-ref: stackoverflow