Skip to content

Commit

Permalink
Revert "feat: clean directories before initial builds (#2875)" (#3005)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-ebey authored Apr 27, 2022
1 parent 1e15555 commit 9cd670f
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ export async function build(

let start = Date.now();
let config = await readConfig(remixRoot);

cleanBuildDirectories(config);

await compiler.build(config, {
mode: mode,
sourcemap,
Expand Down Expand Up @@ -196,8 +193,6 @@ export async function watch(
broadcast({ type: "LOG", message });
}

cleanBuildDirectories(config);

let closeWatcher = await compiler.watch(config, {
mode,
onInitialBuild,
Expand Down Expand Up @@ -311,12 +306,3 @@ function purgeAppRequireCache(buildPath: string) {
}
}
}

function cleanBuildDirectories(config: RemixConfig) {
try {
fse.emptyDirSync(config.assetsBuildDirectory);
fse.emptyDirSync(path.dirname(config.serverBuildPath));
} catch (err) {
console.error("Could not clean build directories");
}
}

0 comments on commit 9cd670f

Please sign in to comment.