File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change 1- import { defineConfig } from "vite" ;
2- import react from "@vitejs/plugin-react" ;
3- import svgr from "vite-plugin-svgr" ;
4- import { crx } from "@crxjs/vite-plugin" ;
5- import manifest from "./manifest.json" ;
1+ import { defineConfig , Plugin } from 'vite' ;
2+ import react from '@vitejs/plugin-react' ;
3+ import { crx } from '@crxjs/vite-plugin' ;
4+ import manifest from './manifest.json' ;
5+
6+ const viteManifestHackIssue846 : Plugin & { renderCrxManifest : ( manifest : any , bundle : any ) => void } = {
7+ // Workaround from https://github.com/crxjs/chrome-extension-tools/issues/846#issuecomment-1861880919.
8+ name : 'manifestHackIssue846' ,
9+ apply : 'build' ,
10+ renderCrxManifest ( _manifest , bundle ) {
11+ bundle [ 'manifest.json' ] = bundle [ '.vite/manifest.json' ]
12+ bundle [ 'manifest.json' ] . fileName = 'manifest.json'
13+ delete bundle [ '.vite/manifest.json' ]
14+ } ,
15+ }
616
7- // https://vitejs.dev/config/
817export default defineConfig ( {
918 plugins : [
1019 react ( ) ,
11- svgr ( {
12- svgrOptions : {
13- icon : true ,
14- // ...svgr options (https://react-svgr.com/docs/options/)
15- } ,
16- } ) ,
17- // Build Chrome Extension
20+ viteManifestHackIssue846 ,
1821 crx ( { manifest } ) ,
1922 ] ,
2023} ) ;
You can’t perform that action at this time.
0 commit comments