-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtsup.config.ts
38 lines (37 loc) · 997 Bytes
/
tsup.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
33
34
35
36
37
38
import { defineConfig } from 'tsup';
import { isDev, r } from './scripts/utils';
import AutoImport from 'unplugin-auto-import/esbuild';
export default defineConfig({
outDir: 'extension/dist',
entry: {
'background/index': './src/background/main.ts',
'contentScripts/inject/content':
'./src/contentScripts/inject/content.ts',
'contentScripts/inject/injected':
'./src/contentScripts/inject/injected.ts',
},
format: ['iife'],
splitting: false,
sourcemap: isDev ? 'inline' : false,
define: {
__DEV__: JSON.stringify(isDev),
'process.env.NODE_ENV': isDev ? '"production"' : '"development"',
'process.env.MANIFEST_VERSION': JSON.stringify(
process.env.MANIFEST_VERSION
),
},
watch: isDev ? ['src/**/*'] : false,
minifyWhitespace: !isDev,
minifySyntax: !isDev,
target: ['chrome58', 'firefox57'],
esbuildPlugins: [
AutoImport({
imports: [
{
'webextension-polyfill': [['default', 'browser']],
},
],
dts: r('src/auto-imports.d.ts'),
}),
],
});