Skip to content

Commit

Permalink
✨ Add support for static directory
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jan 24, 2021
1 parent dfd529a commit 2740579
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion post-process.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readFile, writeFile, copyFile, copy, remove } from "fs-extra";
import { readFile, writeFile, copyFile, copy, remove, pathExists } from "fs-extra";
import { load } from "js-yaml";
import { join } from "path";
import { execSync } from "child_process";
Expand All @@ -22,6 +22,9 @@ export const postProcess = async () => {
await remove(join(".", "__sapper__", "export", baseUrl));
}

if (pathExists(join(".", "static")))
await copy(join(".", "static"), join("__sapper__", "export"), { recursive: true });

if (config["status-website"] && config["status-website"].cname)
await writeFile(join(".", "__sapper__", "export", "CNAME"), config["status-website"].cname);

Expand Down

0 comments on commit 2740579

Please sign in to comment.