properly encode the version

This commit is contained in:
Yanick Champoux 2023-05-11 12:56:04 -04:00
parent 5b53411601
commit 08e6c0de0d
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<div class="header"> <div class="header">
<h2>Welcome to the docks!</h2> <h2>Welcome to the docks!</h2>
<div>version {`import.meta.env.PACKAGE_VERSION`}</div> <div>version {import.meta.env.PACKAGE_VERSION}</div>
</div> </div>
<p> <p>

View File

@ -11,8 +11,9 @@ const config = {
ssr: {}, ssr: {},
optimizeDeps: {}, optimizeDeps: {},
define: { define: {
"import.meta.env.PACKAGE_VERSION": "import.meta.env.PACKAGE_VERSION": JSON.stringify(
'"' + git.gitDescribeSync().semverString + '"', git.gitDescribeSync().semverString
),
"import.meta.env.HOMEPAGE": JSON.stringify(packageJson.homepage), "import.meta.env.HOMEPAGE": JSON.stringify(packageJson.homepage),
"import.meta.env.BUGS": JSON.stringify(packageJson.bugs.url), "import.meta.env.BUGS": JSON.stringify(packageJson.bugs.url),
}, },