Add app version provider

This commit is contained in:
Leonardo Murça 2022-11-27 12:34:39 -03:00
parent d9a1d623df
commit 5f3d8314f9
3 changed files with 10 additions and 1 deletions

View file

@ -1,7 +1,7 @@
{
"name": "embroidery-viewer",
"private": true,
"version": "0.0.0",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",

6
src/utils/env.js Normal file
View file

@ -0,0 +1,6 @@
// @ts-nocheck
function appVersion() {
return APP_VERSION;
}
export { appVersion };

View file

@ -4,4 +4,7 @@ import { svelte } from "@sveltejs/vite-plugin-svelte";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte()],
define: {
APP_VERSION: JSON.stringify(process.env.npm_package_version),
},
});