Skip to content

Commit

Permalink
refactor(dev): update imports and types for compiler in commands
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Oct 27, 2022
1 parent ccddde6 commit 1222b12
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -148,7 +147,7 @@ export async function build(
modeArg?: string,
sourcemap: boolean = false
): Promise<void> {
let mode = parseMode(modeArg, "production");
let mode = compiler.parseMode(modeArg ?? "", "production");

log(`Building Remix app in ${mode} mode...`);

Expand All @@ -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();
},
});
Expand All @@ -193,7 +192,7 @@ export async function watch(
callbacks?: WatchCallbacks
): Promise<void> {
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();
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 1222b12

Please sign in to comment.