-
-
Save i-like-robots/29b8662210f6898626f40d49e8e39e68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dist/index.cjs | |
'use strict'; | |
function Foo() { | |
} | |
module.exports = Foo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dist/index.d.cts | |
declare function Foo(): void; | |
export { Foo as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/index.ts | |
export default function Foo() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test-case", | |
"version": "1.0.0", | |
"exports": { | |
"require": { | |
"types": "./dist/index.d.cts", | |
"default": "./dist/index.cjs" | |
}, | |
"import": { | |
"types": "./dist/index.d.mts", | |
"default": "./dist/index.mjs" | |
} | |
}, | |
"scripts": { | |
"build": "pkgroll" | |
}, | |
"devDependencies": { | |
"@types/node": "^18.11.8", | |
"pkgroll": "^2.0.1", | |
"typescript": "^5.0.0" | |
}, | |
"engines": { | |
"node": ">= 18.0.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @ts-check | |
const Foo = require('./dist/index.cjs'); | |
new Foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment