-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtsup.config.ts
More file actions
35 lines (33 loc) · 752 Bytes
/
tsup.config.ts
File metadata and controls
35 lines (33 loc) · 752 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
import { defineConfig, Options } from 'tsup';
import { esbuildPluginVersionInjector } from './src';
const baseOptions: Options = {
clean: true,
dts: true,
entry: ['src/index.ts'],
minify: false,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'es2021',
tsconfig: 'src/tsconfig.json',
keepNames: true,
treeshake: true,
esbuildPlugins: [
esbuildPluginVersionInjector({
injectTag: '[InternalVi]{{internal-inject}}[/InternalVi]'
})
]
};
export default [
defineConfig({
...baseOptions,
outDir: 'dist/cjs',
format: 'cjs',
outExtension: () => ({ js: '.cjs' })
}),
defineConfig({
...baseOptions,
outDir: 'dist/esm',
format: 'esm',
outExtension: () => ({ js: '.mjs' })
})
];