Migration
Migration from v0.3.* to v0.4.*
In order to support programmatically injecting script, the placeholder is changed:
x
html<script id="import_meta_env"></script>
✅
jsglobalThis.import_meta_env = JSON.parse('"import_meta_env_placeholder"');
Migration from v0.2.* to v0.3.*
The entire environment variables accessing are dropped, use dedicated environment variables instead:
x
jsconst env = import.meta.env; env.HELLO;
✅
jsimport.meta.env.HELLO;
The computed environment variables are dropped, use static environment variables instead:
x
jsimport.meta.env["HELLO"];
✅
jsimport.meta.env.HELLO;
In order to inject environment variables at runtime, you need to add a special script tag to your
index.html
:html<script id="import_meta_env"></script>