diff options
-rw-r--r-- | .prettierrc | 7 | ||||
-rw-r--r-- | bundle/scripts/build.js | 73 |
2 files changed, 33 insertions, 47 deletions
diff --git a/.prettierrc b/.prettierrc index 8dc2e726..7d715cba 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,7 @@ { "tabWidth": 4, - "useTabs": true -} + "useTabs": true, + "printWidth": 140, + "trailingComma": "none", + "useTabs": true +} \ No newline at end of file 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" + } + ) + ); } |