From 453e6e1e0cb1e2407bd49c635b3a57dc90b13ec7 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Sat, 28 Sep 2019 09:45:01 +0200 Subject: [PATCH] have build toggle for offline support --- scripts/build.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/build.mjs b/scripts/build.mjs index f5ed5abc..b0085790 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -15,6 +15,7 @@ const projectDir = path.join(__dirname, "../"); const targetDir = path.join(projectDir, "target"); const debug = true; +const offline = true; async function build() { // get version number @@ -26,7 +27,9 @@ async function build() { await buildHtml(); await buildJs(); await buildCss(); - await buildOffline(version); + if (offline) { + await buildOffline(version); + } console.log(`built brawl ${version} successfully`); } @@ -42,8 +45,10 @@ async function buildHtml() { removeOrEnableScript(doc("script#phone-debug-pre"), debug); removeOrEnableScript(doc("script#phone-debug-post"), debug); removeOrEnableScript(doc("script#service-worker"), false); - doc("html").attr("manifest", "manifest.appcache"); - doc("head").append(``); + if (offline) { + doc("html").attr("manifest", "manifest.appcache"); + doc("head").append(``); + } await fs.writeFile(path.join(targetDir, "index.html"), doc.html(), "utf8"); }