Fix declaration emit in --moduleResolution bundler using wrong exports conditions (#56265)

This commit is contained in:
Andrew Branch
2023-10-30 17:39:57 -05:00
committed by GitHub
parent 60ce788302
commit 0ee2db33ca
5 changed files with 87 additions and 18 deletions

View File

@@ -0,0 +1,35 @@
// @module: esnext
// @moduleResolution: bundler
// @declaration: true
// @emitDeclarationOnly: true
// @noTypesAndSymbols: true
// @Filename: /node_modules/pkg/package.json
{
"name": "pkg",
"type": "module",
"exports": {
".": {
"import": "./index.js",
"require": "./index.cjs"
}
}
}
// @Filename: /node_modules/pkg/index.d.ts
export declare class C {
private p;
}
// @Filename: /node_modules/pkg/index.d.cts
export {};
// @Filename: /makeC.ts
import { C } from "pkg";
export function makeC() {
return new C();
}
// @Filename: /index.ts
import { makeC } from "./makeC";
export const c = makeC();