Skip to content

Commit 40e49d9

Browse files
committed
refactor: simplify node: usage for now
1 parent bf4bdb1 commit 40e49d9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/_utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { PackageJson } from "pkg-types";
2+
import { readPackageJSON } from "pkg-types";
23
import { defu } from "defu";
34

45
export async function getPkg(dir: string, input: Record<string, string> = {}) {
5-
const { readPackageJSON } = await import("pkg-types");
66
const pkg = await readPackageJSON(dir).catch(() => undefined);
77
return defu(
88
{

src/automd.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { existsSync, promises as fsp } from "node:fs";
12
import type { Config, ResolvedConfig } from "./config";
23
import { TransformResult, transform } from "./transform";
4+
import { loadConfig } from "./config";
35

46
export interface AutomdResult extends TransformResult {
57
config: ResolvedConfig;
68
}
79

810
export async function automd(_config: Config = {}): Promise<AutomdResult> {
9-
const { existsSync, promises: fsp } = await import("node:fs");
10-
const { loadConfig } = await import("./config");
1111
const config = await loadConfig(_config.dir, _config);
1212

1313
if (!existsSync(config.input)) {

0 commit comments

Comments
 (0)