moltar / tsup-dts-resolve

tsup ts def bundling repro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tsup dts resolve repro

A repro example of tsup option for resolving type defs not working.

See src/index.ts file, which is simply exporting the types from an external package.

Build:

$> npm run build

> tsup-dts-resolve@1.0.0 build
> tsup

CLI Building entry: src/index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v7.2.0
CLI Using tsup config: /.../tsup-dts-resolve/tsup.config.ts
CLI Target: es2020
CLI Cleaning output folder
CJS Build start
CJS lib/index.js 1.03 KB
CJS ⚡️ Build success in 5ms
DTS Build start
DTS ⚡️ Build success in 369ms
DTS lib/index.d.ts 126.00 B

> tsup-dts-resolve@1.0.0 postbuild
> cat lib/index.d.ts
// test
import { DependencyType } from '@changesets/types';

type MyDependencyType = DependencyType;
declare const config: MyDependencyType;

export { MyDependencyType, config };

About

tsup ts def bundling repro


Languages

Language:JavaScript 63.8%Language:TypeScript 36.2%