Skip to content

Commit 6680bde

Browse files
committed
add conditional import
1 parent 7a18e60 commit 6680bde

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/env.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import fs from 'fs';
22
import { Context } from 'hono';
33
import { env, getRuntimeKey } from 'hono/adapter';
4-
import path from 'path';
54

65
const isNodeInstance = getRuntimeKey() == 'node';
6+
let path: any;
7+
if (isNodeInstance) {
8+
path = await import('path');
9+
}
710

811
export function getValueOrFileContents(value?: string, ignore?: boolean) {
912
if (!value || ignore) return value;

0 commit comments

Comments
 (0)