Use some fsPromises functions.

This commit is contained in:
Dillon Kearns 2021-07-14 09:03:17 -07:00
parent cf58268c23
commit 2864cfcc58

View File

@ -230,9 +230,11 @@ async function runTerser(filePath) {
} }
async function copyAssets() { async function copyAssets() {
fs.writeFile( await fsPromises.writeFile(
"dist/elm-pages.js", "dist/elm-pages.js",
fs.readFileSync(path.join(__dirname, "../static-code/elm-pages.js")) await fsPromises.readFile(
path.join(__dirname, "../static-code/elm-pages.js")
)
); );
fs.copyDirFlat("public", "dist"); fs.copyDirFlat("public", "dist");
} }
@ -245,8 +247,8 @@ async function compileCliApp(options) {
"./elm-stuff/elm-pages" "./elm-stuff/elm-pages"
); );
const elmFileContent = await fs.readFile(ELM_FILE_PATH, "utf-8"); const elmFileContent = await fsPromises.readFile(ELM_FILE_PATH, "utf-8");
await fs.writeFile( await fsPromises.writeFile(
ELM_FILE_PATH, ELM_FILE_PATH,
elmFileContent elmFileContent
.replace( .replace(