mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Fix declaration emit in --moduleResolution bundler using wrong exports conditions (#56265)
This commit is contained in:
35
tests/cases/compiler/declarationEmitBundlerConditions.ts
Normal file
35
tests/cases/compiler/declarationEmitBundlerConditions.ts
Normal 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();
|
||||
Reference in New Issue
Block a user