Skip to content

Commit

Permalink
fix: Creates CJS type declarations for CJS export. (#138)
Browse files Browse the repository at this point in the history
fixes #136
  • Loading branch information
nzakas committed Apr 26, 2024
1 parent b3bce07 commit 26b6eb7
Show file tree
Hide file tree
Showing 11 changed files with 8,496 additions and 13 deletions.
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

0 comments on commit 26b6eb7

Please sign in to comment.