From 2864cfcc589eafb17990273a813363d60530b4f7 Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Wed, 14 Jul 2021 09:03:17 -0700 Subject: [PATCH] Use some fsPromises functions. --- generator/src/build.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/generator/src/build.js b/generator/src/build.js index 8ff204e7..87aa7b81 100755 --- a/generator/src/build.js +++ b/generator/src/build.js @@ -230,9 +230,11 @@ async function runTerser(filePath) { } async function copyAssets() { - fs.writeFile( + await fsPromises.writeFile( "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"); } @@ -245,8 +247,8 @@ async function compileCliApp(options) { "./elm-stuff/elm-pages" ); - const elmFileContent = await fs.readFile(ELM_FILE_PATH, "utf-8"); - await fs.writeFile( + const elmFileContent = await fsPromises.readFile(ELM_FILE_PATH, "utf-8"); + await fsPromises.writeFile( ELM_FILE_PATH, elmFileContent .replace(