From 907288455a14edb45db2ce87f2871d58f43fbfc5 Mon Sep 17 00:00:00 2001 From: tresabhi Date: Thu, 10 Aug 2023 19:28:52 +0000 Subject: [PATCH] changed to js --- package.json | 6 +++--- scripts/{build.ts => build.js} | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) rename scripts/{build.ts => build.js} (77%) diff --git a/package.json b/package.json index 10b66aac2..97259d2b3 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,11 @@ "main": "src/server.ts", "type": "module", "scripts": { - "build:bot": "vite-node --script scripts/build --build=bot", - "build:server": "vite-node --script scripts/build --build=server", + "build:bot": "node scripts/build --build=bot", + "build:server": "node scripts/build --build=server", "build:docs": "vitepress build docs", "build:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard", - "build": "vite-node --script scripts/build --build=all", + "build": "node scripts/build --build=all", "dev:bot": "yarn build:bot --dev && yarn start:bot", "dev:server": "yarn build:server --dev && yarn start:server", "dev:docs": "vitepress dev docs", diff --git a/scripts/build.ts b/scripts/build.js similarity index 77% rename from scripts/build.ts rename to scripts/build.js index 65d43e8ef..eae8ca6f5 100644 --- a/scripts/build.ts +++ b/scripts/build.js @@ -1,11 +1,11 @@ -import { BuildOptions, build } from 'esbuild'; +import { build } from 'esbuild'; import { copyFile, mkdirSync, rmSync } from 'fs'; import { argv } from 'process'; -const isProd = argv === undefined || !argv.includes('--dev'); -const buildAll = argv === undefined || argv.includes('--build=all'); -const buildBot = argv?.includes('--build=bot') || buildAll; -const buildServer = argv?.includes('--build=server') || buildAll; +const isProd = !argv.includes('--dev'); +const buildAll = argv.includes('--build=all'); +const buildBot = argv.includes('--build=bot') || buildAll; +const buildServer = argv.includes('--build=server') || buildAll; if (isProd) { // only remove in production to ensure no time is wasted in dev @@ -23,7 +23,7 @@ if (isProd) { ); } -const commonOptions: BuildOptions = { +const commonOptions = { platform: 'node', loader: { '.node': 'copy',