-
Notifications
You must be signed in to change notification settings - Fork 8
/
vite.config.base.ts
46 lines (41 loc) · 1.3 KB
/
vite.config.base.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import { defineDynamicResource, ManifestV3Export } from '@crxjs/vite-plugin';
import { defineConfig, BuildOptions } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths'
import { stripDevIcons, } from './custom-vite-plugins';
import manifest from './manifest.json';
import devManifest from './manifest.dev.json';
import pkg from './package.json';
const isDev = process.env.__DEV__ === 'true';
// set this flag to true, if you want localization support
// const localize = false;
export const baseManifest = {
...manifest,
version: pkg.version,
...(isDev ? devManifest : ({} as ManifestV3Export)),
// ...(localize ? {
// name: '__MSG_extName__',
// description: '__MSG_extDescription__',
// default_locale : 'en'
// } : {})
web_accessible_resources: [
...manifest.web_accessible_resources,
defineDynamicResource({
matches: ["*://*.youtube.com/*", "*://*.holodex.net/*"],
}),
],
} as ManifestV3Export;
export const baseBuildOptions: BuildOptions = {
sourcemap: isDev,
emptyOutDir: !isDev
}
export default defineConfig({
plugins: [
tsconfigPaths(),
react(),
stripDevIcons(isDev),
// crxI18n({ localize, src: './src/locales' })
],
publicDir: resolve(__dirname, 'public'),
});