mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
be5de2a808
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
45 lines
968 B
TypeScript
45 lines
968 B
TypeScript
//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts] ////
|
|
|
|
//// [index.js]
|
|
// cjs format file
|
|
export async function main() {
|
|
const { readFile } = await import("fs");
|
|
}
|
|
//// [index.js]
|
|
// esm format file
|
|
export async function main() {
|
|
const { readFile } = await import("fs");
|
|
}
|
|
//// [package.json]
|
|
{
|
|
"name": "package",
|
|
"private": true,
|
|
"type": "module"
|
|
}
|
|
//// [package.json]
|
|
{
|
|
"type": "commonjs"
|
|
}
|
|
//// [types.d.ts]
|
|
declare module "fs";
|
|
|
|
//// [index.js]
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.main = main;
|
|
// cjs format file
|
|
async function main() {
|
|
const { readFile } = await import("fs");
|
|
}
|
|
//// [index.js]
|
|
// esm format file
|
|
export async function main() {
|
|
const { readFile } = await import("fs");
|
|
}
|
|
|
|
|
|
//// [index.d.ts]
|
|
export declare function main(): Promise<void>;
|
|
//// [index.d.ts]
|
|
export declare function main(): Promise<void>;
|