use sourcemaps

This commit is contained in:
Erik 2023-12-08 23:13:09 +02:00
parent 8dc57444b2
commit 3d5909724f
3 changed files with 10 additions and 5 deletions

View File

@ -2,7 +2,8 @@
"rootDir": "Should be overwritten in index.ts", "rootDir": "Should be overwritten in index.ts",
"shardOptions": { "shardOptions": {
"totalShards": "auto", "totalShards": "auto",
"respawn": true "respawn": true,
"execArgv": ["--enable-source-maps"]
}, },
"discord": { "discord": {
"prefix": "!", "prefix": "!",

View File

@ -10,7 +10,7 @@
"debug": "node --trace-warnings --inspect index.js", "debug": "node --trace-warnings --inspect index.js",
"update": "git pull && cd api && yarn update", "update": "git pull && cd api && yarn update",
"test": "jest --detectOpenHandles", "test": "jest --detectOpenHandles",
"lint": "eslint --fix src/**", "lint": "eslint --fix src/",
"build": "tsc --build" "build": "tsc --build"
}, },
"repository": { "repository": {

View File

@ -53,7 +53,7 @@ class Controller extends EventEmitter
throw new Error(`Client path does not seem to exist: ${clientPath}`); throw new Error(`Client path does not seem to exist: ${clientPath}`);
this.#options = options; this.#options = options;
const { shardList, totalShards } = Controller.parseShardOptions(options.shardOptions); const { shardList, totalShards, execArgv } = Controller.parseShardOptions(options.shardOptions);
options.discord.rootDir = options.rootDir; options.discord.rootDir = options.rootDir;
options.discord.logger = options.logger; options.discord.logger = options.logger;
@ -65,7 +65,7 @@ class Controller extends EventEmitter
shardList, shardList,
respawn, respawn,
shardArgs: [], shardArgs: [],
execArgv: [], execArgv,
token: process.env.DISCORD_TOKEN, token: process.env.DISCORD_TOKEN,
clientOptions: options.discord, clientOptions: options.discord,
}; };
@ -346,7 +346,11 @@ class Controller extends EventEmitter
if (!Number.isInteger(totalShards)) if (!Number.isInteger(totalShards))
throw new Error('TotalShards must be an integer.'); throw new Error('TotalShards must be an integer.');
} }
return { shardList, totalShards };
let { execArgv } = options;
if (!execArgv)
execArgv = [];
return { shardList, totalShards, execArgv };
} }
get version () get version ()