nystudio107 / craft-plugin-vite

Plugin Vite is the conduit between Craft CMS plugins and Vite, with manifest.json & HMR support
MIT License
12 stars 11 forks source link

Consistent use of "useDevServer" #1

Closed nicolasbinet closed 3 years ago

nicolasbinet commented 3 years ago

Describe the bug

The plugin uses two "DEV_MODE" & "VITE_PLUGIN_DEVSERVER" env variables. And not there values but juste the presence of the variable

Expected behaviour

It should only take "useDevServer" in config/vite.php

Versions

khalwat commented 3 years ago

So the DEV_MODE env variable is coming from Craft CMS. It doesn't look at this variable anywhere, I just have it as an example in the default config.php -- you can change that to whatever you want.

The VITE_PLUGIN_DEVSERVER is a very specific thing, but only for plugin or module developer who are using the stand-alone https://github.com/nystudio107/craft-plugin-vite -- and the reason for that is to make sure the plugin doesn't attempt to use the dev server on non-dev client environments.