fork of hey-api/openapi-ts because I need some additional things
1import { defineConfig } from 'tsdown';
2
3export default defineConfig({
4 banner(ctx) {
5 /**
6 * fix dynamic require in ESM
7 * @link https://github.com/hey-api/openapi-ts/issues/1079
8 */
9 if (ctx.format === 'esm') {
10 return {
11 js: `import { createRequire } from 'module'; const require = createRequire(import.${'meta'}.url);`,
12 };
13 }
14 },
15 clean: true,
16 dts: true,
17 entry: ['src/index.ts'],
18 format: ['cjs', 'esm'],
19 minify: false,
20 shims: false,
21 sourcemap: true,
22 treeshake: true,
23});