Skip to content

Commit

Permalink
Auto-replace manifest version with package.json version
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunock committed May 12, 2024
1 parent 242f90a commit c5198f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 7 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5198f3

Please sign in to comment.