12 lines
374 B
TypeScript
12 lines
374 B
TypeScript
// utils/nanoSpawn.ts
|
|
// we do this because we need to use dynamic import() when using ESM only module via tsup CJS interop.
|
|
|
|
|
|
let nanoSpawnPromise: Promise<typeof import('nano-spawn').default> | null = null;
|
|
|
|
export async function getNanoSpawn() {
|
|
if (!nanoSpawnPromise) {
|
|
nanoSpawnPromise = import('nano-spawn').then(m => m.default);
|
|
}
|
|
return nanoSpawnPromise;
|
|
} |