Files
2025-07-15 04:07:59 +00:00

25 lines
1006 B
JavaScript

// NOTE: This file is used to build type bundles for use with the XO Stack playground.
// The XO Stack Playground uses Monaco Editor - which requires that types are all bundled in a single file.
// (Technically, we can load many individual files, but resolution is incredibly slow and complex)
import dts from 'rollup-plugin-dts';
import { defineConfig } from 'rollup';
import pkg from './package.json' with { type: 'json' };
export default defineConfig({
input: 'dist/index.d.ts',
output: {
file: 'dist/types-bundled.d.ts',
format: 'es',
},
// Omit all dependencies and peer dependencies from the final type bundle.
// TODO: We may actually want to include these, but are unable to get it to work currently.
// The advantage would be that we can produce bundles that also contain dependent types.
// For example: LibAuth.
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
plugins: [dts()],
});