generated from sinanbekar/browser-extension-react-typescript-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
32 lines (31 loc) · 863 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { crx } from '@crxjs/vite-plugin';
import react from '@vitejs/plugin-react';
import { join, resolve } from 'path';
import { defineConfig } from 'vite';
import manifest from './src/manifest';
export default defineConfig({
// @see https://github.com/crxjs/chrome-extension-tools/issues/696
server: {
port: 5173,
strictPort: true,
hmr: {
port: 5173,
},
},
// prevent src/ prefix on extension urls
root: resolve(__dirname, 'src'),
publicDir: resolve(__dirname, 'public'),
build: {
outDir: resolve(__dirname, 'dist'),
rollupOptions: {
input: {
// see web_accessible_resources in the manifest config
welcome: join(__dirname, 'src/welcome/welcome.html'),
},
output: {
chunkFileNames: 'assets/chunk-[hash].js',
},
},
},
plugins: [react(), crx({ manifest })],
});