mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
23 lines
553 B
TypeScript
23 lines
553 B
TypeScript
// @target: esnext
|
|
// @module: preserve
|
|
// @moduleResolution: bundler
|
|
// @verbatimModuleSyntax: true
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
// @noEmit: true
|
|
|
|
// @filename: dep.cjs
|
|
module.exports.readFile = function () {};
|
|
|
|
// @filename: main.cjs
|
|
// CommonJS `require` is not ESM syntax, in destructured or plain form.
|
|
const { readFile } = require("./dep.cjs");
|
|
const dep = require("./dep.cjs");
|
|
readFile;
|
|
dep;
|
|
|
|
// @filename: esm.cjs
|
|
// Genuine ESM syntax in a CommonJS file must still be an error.
|
|
import { readFile as fromEsm } from "./dep.cjs";
|
|
fromEsm;
|