Skip to content

Commit

Permalink
fix: rename toybox index to index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarkivra committed Feb 24, 2022
1 parent 3f4a26e commit 1621223
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cli/vite-build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { build } from "vite";
import { writeFileSync, unlinkSync } from "fs";
import { writeFileSync, unlinkSync, renameSync } from "fs";
import { join } from "path";
import { Config } from "../types";
import { getPlugins } from "./vite-plugin";
Expand All @@ -23,6 +23,10 @@ export async function buildApp(config: Config): Promise<void> {
},
},
});
renameSync(
join(process.cwd(), config.outDir, tempIndexName),
join(process.cwd(), config.outDir, "index.html")
);
unlinkSync(indexFileName);
} catch (error) {
unlinkSync(indexFileName);
Expand Down

0 comments on commit 1621223

Please sign in to comment.