-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtsup.config.ts
More file actions
36 lines (34 loc) · 809 Bytes
/
tsup.config.ts
File metadata and controls
36 lines (34 loc) · 809 Bytes
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
import {polyfillNode} from 'esbuild-plugin-polyfill-node';
import svgrPlugin from 'esbuild-plugin-svgr';
import {defineConfig} from 'tsup';
import packageJSON from './package.json';
export default defineConfig({
tsconfig: './tsconfig.element.json',
esbuildPlugins: [
svgrPlugin(),
polyfillNode({
globals: {
buffer: true,
},
polyfills: {
crypto: true,
},
}),
],
entry: ['src/element.tsx'],
outDir: 'widget',
sourcemap: false,
minify: true,
// treeshake: true,
platform: 'browser',
bundle: true,
target: 'es2020',
define: {
global: 'window',
'process.env.NODE_ENV': '"production"',
},
splitting: false,
external: ['child_process', 'os'],
format: ['esm'],
noExternal: [...Object.keys(packageJSON.dependencies)],
});