Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Creates CJS type declarations for CJS export. #138

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,063 changes: 2,062 additions & 1 deletion package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"types": "dist/env.d.ts",
"exports": {
"require": {
"types": "./dist/env.d.ts",
"types": "./dist/env.d.cts",
"default": "./dist/env.cjs"
},
"import": {
Expand All @@ -35,7 +35,7 @@
"url": "https://github.com/sponsors/nzakas"
},
"scripts": {
"build": "rollup -c && tsc",
"build": "rollup -c && tsc && tsc -p tsconfig.cjs.json",
"prepare": "npm run build",
"lint": "eslint src/ tests/",
"pretest": "npm run build",
Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/ts-project-module-commonjs-node16/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const env_1 = require("@humanwhocodes/env");
const env = new env_1.Env();
const username = env.get("USERNAME");
4 changes: 4 additions & 0 deletions tests/fixtures/ts-project-module-commonjs-node16/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Env } from "@humanwhocodes/env";

const env = new Env();
const username = env.get("USERNAME");
Loading