File tree 1 file changed +16
-13
lines changed 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
+ }
6
16
7
- // https://vitejs.dev/config/
8
17
export default defineConfig ( {
9
18
plugins : [
10
19
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 ,
18
21
crx ( { manifest } ) ,
19
22
] ,
20
23
} ) ;
You can’t perform that action at this time.
0 commit comments