mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
23 lines
621 B
TypeScript
23 lines
621 B
TypeScript
import { defineConfig } from 'tsup'
|
|
import { isDev } from './scripts/utils'
|
|
|
|
export default defineConfig(() => ({
|
|
entry: {
|
|
'background/index': './src/background/index.ts',
|
|
...(isDev ? { mv3client: './scripts/client.ts' } : {}),
|
|
},
|
|
outDir: 'extension/dist',
|
|
format: ['esm'],
|
|
target: 'esnext',
|
|
ignoreWatch: ['**/extension/**'],
|
|
splitting: false,
|
|
sourcemap: isDev ? 'inline' : false,
|
|
define: {
|
|
'__DEV__': JSON.stringify(isDev),
|
|
'process.env.NODE_ENV': JSON.stringify(isDev ? 'development' : 'production'),
|
|
},
|
|
platform: 'browser',
|
|
minifyWhitespace: !isDev,
|
|
minifySyntax: !isDev,
|
|
}))
|