summary refs log tree commit diff
path: root/bundle/scripts/build.js
diff options
context:
space:
mode:
Diffstat (limited to 'bundle/scripts/build.js')
-rw-r--r--bundle/scripts/build.js73
1 files changed, 28 insertions, 45 deletions
diff --git a/bundle/scripts/build.js b/bundle/scripts/build.js
index c00c2eaa..549e340f 100644
--- a/bundle/scripts/build.js
+++ b/bundle/scripts/build.js
@@ -9,57 +9,40 @@ const dirs = ["api", "util", "cdn", "gateway", "bundle"];
 const verbose = argv.includes("verbose") || argv.includes("v");
 
 if (argv.includes("clean")) {
-  dirs.forEach((a) => {
-    var d = "../" + a + "/dist";
-    if (fse.existsSync(d)) {
-      fse.rmSync(d, { recursive: true });
-      if (verbose) console.log(`Deleted ${d}!`);
-    }
-  });
+	dirs.forEach((a) => {
+		var d = "../" + a + "/dist";
+		if (fse.existsSync(d)) {
+			fse.rmSync(d, { recursive: true });
+			if (verbose) console.log(`Deleted ${d}!`);
+		}
+	});
 }
 
-fse.copySync(
-  path.join(__dirname, "..", "..", "api", "assets"),
-  path.join(__dirname, "..", "dist", "api", "assets")
-);
-fse.copySync(
-  path.join(__dirname, "..", "..", "api", "client_test"),
-  path.join(__dirname, "..", "dist", "api", "client_test")
-);
-fse.copySync(
-  path.join(__dirname, "..", "..", "api", "locales"),
-  path.join(__dirname, "..", "dist", "api", "locales")
-);
+fse.copySync(path.join(__dirname, "..", "..", "api", "assets"), path.join(__dirname, "..", "dist", "api", "assets"));
+fse.copySync(path.join(__dirname, "..", "..", "api", "client_test"), path.join(__dirname, "..", "dist", "api", "client_test"));
+fse.copySync(path.join(__dirname, "..", "..", "api", "locales"), path.join(__dirname, "..", "dist", "api", "locales"));
 dirs.forEach((a) => {
-  fse.copySync("../" + a + "/src", "dist/" + a + "/src");
-  if (verbose)
-    console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`);
+	fse.copySync("../" + a + "/src", "dist/" + a + "/src");
+	if (verbose) console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`);
 });
 
 console.log("Copying src files done");
 if (!argv.includes("copyonly")) {
-  console.log("Compiling src files ...");
+	console.log("Compiling src files ...");
 
-  console.log(
-    execSync(
-      'node "' +
-        path.join(
-          __dirname,
-          "..",
-          "node_modules",
-          "typescript",
-          "lib",
-          "tsc.js"
-        ) +
-        '" -p "' +
-        path.join(__dirname, "..") +
-        '"',
-      {
-        cwd: path.join(__dirname, ".."),
-        shell: true,
-        env: process.env,
-        encoding: "utf8",
-      }
-    )
-  );
+	console.log(
+		execSync(
+			'node "' +
+				path.join(__dirname, "..", "node_modules", "typescript", "lib", "tsc.js") +
+				'" -p "' +
+				path.join(__dirname, "..") +
+				'"',
+			{
+				cwd: path.join(__dirname, ".."),
+				shell: true,
+				env: process.env,
+				encoding: "utf8"
+			}
+		)
+	);
 }