diff --git a/package.json b/package.json index ecdb4ad..c4f3213 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "woj-ui", "private": true, - "version": "0.0.0", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src/main.tsx b/src/main.tsx index 4b168ea..98f8152 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -24,6 +24,7 @@ Sentry.init({ import.meta.env.MODE === "development" ? "" // disable Sentry in development : "https://903205e5bdddd0bb8f7625a63b161764@o4506423190355968.ingest.sentry.io/4506428723757056", + release: "woj-ui@" + import.meta.env.PACKAGE_VERSION, environment: import.meta.env.MODE, integrations: [ new Sentry.BrowserTracing({ diff --git a/tsconfig.node.json b/tsconfig.node.json index 26063d8..6dcef80 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -4,7 +4,11 @@ "skipLibCheck": true, "module": "ESNext", "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true }, - "include": ["vite.config.ts"] + "include": [ + "vite.config.ts", + "./package.json" + ] } diff --git a/vite.config.ts b/vite.config.ts index 52e1533..a5e8d94 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,7 @@ +import react from "@vitejs/plugin-react-swc"; import { defineConfig } from "vite"; import { sentryVitePlugin } from "@sentry/vite-plugin"; -import react from "@vitejs/plugin-react-swc"; +import packageJson from "./package.json"; // https://vitejs.dev/config/ export default defineConfig({ @@ -13,4 +14,7 @@ export default defineConfig({ project: "woj-ui", }), ], + define: { + "import.meta.env.PACKAGE_VERSION": JSON.stringify(packageJson.version), + }, });