forked from microsoft/TypeScript
/
nodeModulesDeclarationEmitDynamicImportWithPackageExports.js
155 lines (151 loc) · 4.14 KB
/
nodeModulesDeclarationEmitDynamicImportWithPackageExports.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//// [tests/cases/conformance/node/nodeModulesDeclarationEmitDynamicImportWithPackageExports.ts] ////
//// [index.ts]
// esm format file
export {};
//// [index.mts]
// esm format file
export {};
//// [index.cts]
// cjs format file
export {};
//// [other.ts]
// esm format file
export const a = await import("package/cjs");
export const b = await import("package/mjs");
export const c = await import("package");
export const f = await import("inner");
//// [other2.ts]
// esm format file
export const d = await import("inner/cjs");
export const e = await import("inner/mjs");
//// [other.mts]
// esm format file
export const a = await import("package/cjs");
export const b = await import("package/mjs");
export const c = await import("package");
export const f = await import("inner");
//// [other2.mts]
// esm format file
export const d = await import("inner/cjs");
export const e = await import("inner/mjs");
//// [other.cts]
// cjs format file, no TLA
export const a = import("package/cjs");
export const b = import("package/mjs");
export const c = import("package");
export const f = import("inner");
//// [other2.cts]
// cjs format file, no TLA
export const d = import("inner/cjs");
export const e = import("inner/mjs");
//// [index.d.ts]
// cjs format file
export const cjsMain = true;
//// [index.d.mts]
// esm format file
export const esm = true;
//// [index.d.cts]
// cjs format file
export const cjsNonmain = true;
//// [package.json]
{
"name": "package",
"private": true,
"type": "module",
"exports": {
"./cjs": "./index.cjs",
"./mjs": "./index.mjs",
".": "./index.js"
}
}
//// [package.json]
{
"name": "inner",
"private": true,
"exports": {
"./cjs": "./index.cjs",
"./mjs": "./index.mjs",
".": "./index.js"
}
}
//// [index.js]
export {};
//// [index.mjs]
export {};
//// [index.cjs]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//// [other.js]
// esm format file
export const a = await import("package/cjs");
export const b = await import("package/mjs");
export const c = await import("package");
export const f = await import("inner");
//// [other2.js]
// esm format file
export const d = await import("inner/cjs");
export const e = await import("inner/mjs");
//// [other.mjs]
// esm format file
export const a = await import("package/cjs");
export const b = await import("package/mjs");
export const c = await import("package");
export const f = await import("inner");
//// [other2.mjs]
// esm format file
export const d = await import("inner/cjs");
export const e = await import("inner/mjs");
//// [other.cjs]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.f = exports.c = exports.b = exports.a = void 0;
// cjs format file, no TLA
exports.a = import("package/cjs");
exports.b = import("package/mjs");
exports.c = import("package");
exports.f = import("inner");
//// [other2.cjs]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.e = exports.d = void 0;
// cjs format file, no TLA
exports.d = import("inner/cjs");
exports.e = import("inner/mjs");
//// [index.d.ts]
export {};
//// [index.d.mts]
export {};
//// [index.d.cts]
export {};
//// [other.d.ts]
export declare const a: {
default: typeof import("package/cjs");
};
export declare const b: typeof import("package/mjs");
export declare const c: typeof import("package");
export declare const f: {
default: typeof import("inner");
cjsMain: true;
};
//// [other2.d.ts]
export declare const d: {
default: typeof import("inner/cjs");
cjsNonmain: true;
};
export declare const e: typeof import("inner/mjs");
//// [other.d.mts]
export declare const a: {
default: typeof import("package/cjs");
};
export declare const b: typeof import("package/mjs");
export declare const c: typeof import("package");
export declare const f: {
default: typeof import("inner");
cjsMain: true;
};
//// [other2.d.mts]
export declare const d: {
default: typeof import("inner/cjs");
cjsNonmain: true;
};
export declare const e: typeof import("inner/mjs");