fork of hey-api/openapi-ts because I need some additional things
1import path from 'node:path';
2
3import { defineConfig } from 'rollup';
4import dts from 'rollup-plugin-dts';
5
6const files = ['index.d.mts', 'index.d.cts', 'plugin.d.mts', 'plugin.d.cts'];
7
8export default files.map((file) =>
9 defineConfig({
10 external: (id) => {
11 const normalizedId = id.split(path.sep).join('/');
12 return !normalizedId.startsWith('/') && !/^[a-zA-Z]:\//.test(normalizedId);
13 },
14 input: `./dist/${file}`,
15 output: {
16 file: `./dist/${file}`,
17 format: 'es',
18 },
19 plugins: [
20 dts({
21 respectExternal: true,
22 }),
23 ],
24 }),
25);