From c5198f38edbafc7a1889b25ba78c80a3d06c99a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kiljan=CC=81czyk?= Date: Sun, 12 May 2024 10:03:12 +0200 Subject: [PATCH] Auto-replace manifest version with package.json version --- manifest.json | 2 +- vite.config.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 2402f42..015f66e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Chrome Extension with React & Vite", - "version": "1.0.0", + "version": "REPLACED-BY-VITE", "description": "A chrome extension boilerplate built with React 18 and Vite 5", "icons": { "34": "assets/icons/icon-34.png", diff --git a/vite.config.ts b/vite.config.ts index f960089..10ca772 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,10 +3,16 @@ import react from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; import manifest from './manifest.json'; +import packageJson from './package.json'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react(), crx({ manifest })], + plugins: [react(), crx({ + manifest: { + ...manifest, + version: packageJson.version + } + })], build: { outDir: 'dist', emptyOutDir: true