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.js36
1 files changed, 25 insertions, 11 deletions
diff --git a/bundle/scripts/build.js b/bundle/scripts/build.js
index 2a82ec57..69111c88 100644
--- a/bundle/scripts/build.js
+++ b/bundle/scripts/build.js
@@ -2,18 +2,32 @@ const { execSync } = require("child_process");
 const path = require("path");
 const fse = require("fs-extra");
 
-const api = path.join(__dirname, "..", "..", "api");
-const dist = path.join(__dirname, "..", "dist");
+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", "src"), path.join(__dirname, "..", "dist", "api", "src"));
+fse.copySync(path.join(__dirname, "..", "..", "util", "src"), path.join(__dirname, "..", "dist", "util", "src"));
+fse.copySync(path.join(__dirname, "..", "..", "cdn", "src"), path.join(__dirname, "..", "dist", "cdn", "src"));
+fse.copySync(path.join(__dirname, "..", "..", "gateway", "src"), path.join(__dirname, "..", "dist", "gateway", "src"));
+fse.copySync(path.join(__dirname, "..", "..", "bundle", "src"), path.join(__dirname, "..", "dist", "bundle", "src"));
 
-fse.copySync(path.join(api, "assets"), path.join(dist, "api", "assets"));
-fse.copySync(path.join(api, "client_test"), path.join(dist, "api", "client_test"));
-fse.copySync(path.join(api, "locales"), path.join(dist, "api", "locales"));
+console.log("Copying   src files done");
+console.log("Compiling src files ...");
 
 console.log(
-	execSync("node " + path.join(__dirname, "..", "node_modules", "typescript", "lib", "tsc.js") + " -p .", {
-		cwd: path.join(__dirname, ".."),
-		shell: true,
-		env: process.env,
-		encoding: "utf8",
-	})
+	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",
+		}
+	)
 );