vite-plugin-html-env
vite-plugin-html-env copied to clipboard
Cannot use or set qualifier
Hi,
thanks for you plugin! I've got "vite-plugin-html-env": "^1.2.7" in my package.json and notices the following:
With this in config:
VitePluginHtmlEnv({
// prefix: '{{',
// suffix: '}}',
compiler: true,
}),
and this index.html
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<title>import.meta.env.VITE_APP_TITLE</title>
</head>
<body>
<noscript>
<strong>We're sorry but import.meta.env.VITE_APP_TITLE doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Everything is working. However, I would have expected to use '<{' and '}>' as qualifiers. If I uncomment prefix and suffix in my above config, I also cannot use '{{' and '}}'. Still the index.html must remain like above to work.
Am I doing anything wrong, or is there a glitch?
Many thanks