Skip to content

Commit 8d83005

Browse files
committed
fix: esm resolution
1 parent 813cbba commit 8d83005

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

src/_tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ChildProcess } from "node:child_process";
22
import fs from "node:fs";
3-
import { bin, install, tunnel } from "../lib";
3+
import { bin, install, tunnel } from "../lib.js";
44

55
process.env.VERBOSE = "1";
66

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from "node:fs";
22
import { spawn } from "node:child_process";
3-
import { bin, install } from "./lib";
3+
import { bin, install } from "./lib.js";
44

55
main();
66

src/lib.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
export { bin } from "./constants";
2-
export { install } from "./install";
3-
export { tunnel, Connection } from "./utils";
1+
export { bin } from "./constants.js";
2+
export { install } from "./install.js";
3+
export { tunnel } from "./utils.js";
4+
export type { Connection } from "./utils.js";

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { spawn, ChildProcess } from "node:child_process";
2-
import { bin } from "./constants";
2+
import { bin } from "./constants.js";
33

44
/**
55
* Create a tunnel.

tsup.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { defineConfig } from "tsup";
22

33
export default defineConfig((options) => ({
4-
entry: ["src/index.ts", "src/lib.ts"],
4+
entry: ["src/*.ts"],
55
outDir: "lib",
66
target: "node14",
77
format: ["cjs", "esm"],
88
shims: true,
99
clean: true,
1010
splitting: false,
11-
// minify: !options.watch,
12-
dts: !options.watch,
11+
bundle: false,
12+
dts: options.watch ? false : { entry: "src/lib.ts" },
1313
}));

0 commit comments

Comments
 (0)