Skip to content

Commit

Permalink
chore: load ts-node on demand (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
PainterPuppets authored Aug 3, 2023
1 parent 4ec4d19 commit 29e87f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/helper.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { loadTsNode } from './typescript-support'
import { willRunWithTypescript, loadTsNode } from './typescript-support'
import { KuaiContext } from './context'
import { KuaiRuntimeEnvironment } from './runtime'
import { loadConfigAndTasks } from './config'
import { KuaiArguments } from './type'

export async function initialKuai(args: KuaiArguments = {}): Promise<KuaiContext> {
loadTsNode()

const ctx = KuaiContext.getInstance()

if (willRunWithTypescript(args.configPath)) {
loadTsNode()
}

const config = await loadConfigAndTasks(args)

const env = new KuaiRuntimeEnvironment(config, ctx.tasksLoader.getTasks(), ctx.extendersManager.getExtenders())
Expand Down

0 comments on commit 29e87f1

Please sign in to comment.