Details
input
// src/index.ts
export { appLoader, type AppLoaderType as AppLoader } from "./core/loader";
output
// dist/esm/index.d.mts
export { appLoader, type AppLoaderType as AppLoader } from "./core/loader";
There exists an error Module './core/loader' or its corresponding type declaration could not be found.ts(2307) in output, so the esm types is incorrect for use.
We should add js extension in .d.ts / .d.cts / .d.mts file to make resolution work as what tsup do when using bundleless DTS.
bundle DTS should not do this since api-extractor can not deal dts file like that.
// dist/esm/index.d.mts
export { appLoader, type AppLoaderType as AppLoader } from "./core/loader.mjs";
references:
- https://www.typescriptlang.org/docs/handbook/modules/theory.html#the-role-of-declaration-files
- What rollup-plugin-dts do
- https://www.typescriptlang.org/tsconfig/#moduleResolution
- Typescript 5.7 -- Path Rewriting for Relative Paths
Details
input
output
There exists an error
Module './core/loader' or its corresponding type declaration could not be found.ts(2307)in output, so the esm types is incorrect for use.We should add js extension in
.d.ts/.d.cts/.d.mtsfile to make resolution work as what tsup do when using bundleless DTS.bundle DTS should not do this since api-extractor can not deal dts file like that.
references: