Skip to content

Commit

Permalink
fix(dev): ensure build dir exists when writing metafiles (#6776)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Jul 6, 2023
1 parent 4233a3e commit da44482
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/remix-dev/compiler/analysis.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from "node:fs";
import fs from "fs-extra";
import path from "node:path";
import type { Metafile } from "esbuild";

Expand All @@ -10,8 +10,5 @@ export let writeMetafile = (
metafile: Metafile
) => {
let buildDir = path.dirname(ctx.config.serverBuildPath);
if (!fs.existsSync(buildDir)) {
fs.mkdirSync(buildDir, { recursive: true });
}
fs.writeFileSync(path.join(buildDir, filename), JSON.stringify(metafile));
fs.outputFileSync(path.join(buildDir, filename), JSON.stringify(metafile));
};

0 comments on commit da44482

Please sign in to comment.