lxs24sxl / vite-plugin-html-env

A vite plugin for rewriting html
82 stars 10 forks source link

Unable to use other import.meta.env variables #29

Open titenis opened 1 year ago

titenis commented 1 year ago

This plugin works fine with env vars defined in .env files, but it ignores all other env variables coming from vite like dev, prod, mode etc. Basically there should be a possibility to use everything that is defined at import.meta.env. Now simple conditional tag is not working:

    <script type="text/javascript" vite-if="import.meta.env.dev">
const var = 'abc';
</script>
lxs24sxl commented 1 year ago

Okay, I'll take care of that.