webfansplz / vite-plugin-vue-inspector

jump to editor source code while click the element of browser automatically.
MIT License
697 stars 74 forks source link

env LAUNCH_EDITOR gets overwritten #92

Closed Smef closed 6 months ago

Smef commented 6 months ago

launch-editor looks for the env variable LAUNCH_EDITOR by default. This is getting overwritten in /packages/core/src/index.ts:174

This package takes a launchEditor option, which is then used to set this variable. Unfortunately this means that you can't set your env to have launch-editor use your preferred IDE.

Is this an intentional override, or would it be an acceptable change to use the process.env.LAUNCH_EDITOR if it's set, even if a launcEditoroption was not set?

This comes up as a problem in both Vue Devtools Next and Nuxt Devtools. Vue Devtools does have a launchEditor option which can be configured, but Nuxt Devtools does not.

Ether way, it seems like it might be good to not overwrite the environment variable for LAUNCH_EDITOR if one has been set.

I could submit a PR for this if this is not being overwritten for a specific reason. I think a good change would be to have the defaults use process.env.LAUNCH_EDITOR if it's set.

Smef commented 6 months ago

PR here: https://github.com/webfansplz/vite-plugin-vue-inspector/pull/93