From 1222b12e28602cbca5a895491546a38b7c33d509 Mon Sep 17 00:00:00 2001 From: Pedro Cattori Date: Wed, 26 Oct 2022 13:32:00 -0400 Subject: [PATCH] refactor(dev): update imports and types for compiler in `commands` --- packages/remix-dev/cli/commands.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/remix-dev/cli/commands.ts b/packages/remix-dev/cli/commands.ts index b4495eb7bfa..f76ac5b9a90 100644 --- a/packages/remix-dev/cli/commands.ts +++ b/packages/remix-dev/cli/commands.ts @@ -12,7 +12,6 @@ import type { createApp as createAppType } from "@remix-run/serve"; import getPort, { makeRange } from "get-port"; import * as esbuild from "esbuild"; -import { parseMode } from "../compiler/options"; import * as colors from "../colors"; import * as compiler from "../compiler"; import type { RemixConfig } from "../config"; @@ -148,7 +147,7 @@ export async function build( modeArg?: string, sourcemap: boolean = false ): Promise { - let mode = parseMode(modeArg, "production"); + let mode = compiler.parseMode(modeArg ?? "", "production"); log(`Building Remix app in ${mode} mode...`); @@ -173,8 +172,8 @@ export async function build( await compiler.build(config, { mode, sourcemap, - onBuildFailure: (failure: compiler.BuildError) => { - compiler.formatBuildFailure(failure); + onBuildFailure: (failure: compiler.CompileFailure) => { + compiler.logCompileFailure(failure); throw Error(); }, }); @@ -193,7 +192,7 @@ export async function watch( callbacks?: WatchCallbacks ): Promise { let { onInitialBuild, onRebuildStart } = callbacks || {}; - let mode = parseMode(modeArg, "development"); + let mode = compiler.parseMode(modeArg ?? "", "development"); console.log(`Watching Remix app in ${mode} mode...`); let start = Date.now(); @@ -278,7 +277,7 @@ export async function dev( } let config = await readConfig(remixRoot); - let mode = parseMode(modeArg, "development"); + let mode = compiler.parseMode(modeArg ?? "", "development"); await loadEnv(config.rootDirectory);